/* MTProxy Portal — mobile-first, no JS framework */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3e;
    --text: #e8eaf0;
    --muted: #8b8fa8;
    --accent: #5b8af5;
    --accent-hover: #7aa3ff;
    --success: #3ecf8e;
    --warn: #f0b429;
    --error: #e85555;
    --radius: 10px;
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 600px;
    padding-top: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.tagline {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.card p {
    color: var(--muted);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.card p em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.85rem;
}

.card.success { border-color: var(--success); }
.card.error   { border-color: var(--error); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: var(--border);
    color: var(--text);
}
.btn-secondary:hover { background: #353850; }

/* Options layout */
.options {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
}

.option {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.divider {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.input-field {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    font-family: var(--font);
    resize: vertical;
    transition: border-color 0.15s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
}

small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

/* Proxy link */
.link-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin: 1rem 0;
    text-align: center;
}

.proxy-link {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.proxy-link:hover { background: var(--accent-hover); }

.link-copy code {
    font-size: 0.7rem;
    color: var(--muted);
    word-break: break-all;
}

/* QR */
.qr-section {
    text-align: center;
    margin: 1.25rem 0;
}

.qr-img {
    max-width: 200px;
    border-radius: var(--radius);
    border: 3px solid var(--border);
    background: #fff;
}

/* Status */
.status-ok   { color: var(--success); margin-bottom: 0.75rem; }
.status-warn { color: var(--warn);    margin-bottom: 0.75rem; }

/* Instructions */
.instructions {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.instructions h3 {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.instructions ol {
    padding-left: 1.4rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.instructions li { margin-bottom: 0.4rem; }
.instructions em { color: var(--muted); font-style: normal; font-size: 0.82rem; }

.save-notice {
    background: #2a1f00;
    border: 1px solid var(--warn);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    color: var(--warn) !important;
    font-size: 0.88rem !important;
    margin-top: 1rem;
}

.back-link {
    margin-top: 1rem;
    text-align: center;
}

.back-link a {
    color: var(--accent);
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.8rem;
}
