/* ===== RESET ===== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #080b12;
    --bg-card: rgba(14, 20, 35, 0.7);
    --bg-card-hover: rgba(18, 26, 45, 0.8);
    --bg-input: rgba(10, 16, 30, 0.8);
    --text-main: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-soft: #7dd3fc;
    --accent-dim: rgba(56, 189, 248, 0.08);
    --accent-glow: rgba(56, 189, 248, 0.12);
    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(56, 189, 248, 0.25);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== BASE ===== */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    background: var(--bg-main);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow */
body::before {
    content: "";
    position: fixed;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 70%;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 50%, rgba(56, 189, 248, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle grid */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 50%);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

a:hover {
    color: #c7d2fe;
}

/* ===== NAV ===== */
nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: rgba(8, 11, 18, 0.75);
    backdrop-filter: blur(20px) saturate(1.3);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-brand-link,
.nav-brand-link:hover,
.nav-brand-link:active,
.nav-brand-link:focus {
    text-decoration: none;
    outline: none;
}

.nav-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.2s var(--ease);
}

.nav-logo:hover {
    opacity: 1;
}

.nav-brand {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    white-space: nowrap;
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 40%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.3));
    transition: filter 0.2s var(--ease);
}

.nav-brand:hover {
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.5));
}

/* Nav links */
.nav-links {
    display: flex;
    margin-left: auto;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 500;
    transition: color 0.2s var(--ease);
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links a.active {
    color: var(--text-main);
}

/* Nav auth buttons */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 32px;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s var(--ease);
    cursor: pointer;
    text-decoration: none;
}

.btn-login,
.btn-register {
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
}

.btn-login:hover,
.btn-register:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
    background: var(--accent-dim);
}

.btn-login.active,
.btn-register.active {
    color: var(--text-main);
    border-color: var(--border-hover);
    background: var(--accent-dim);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 120px 24px 100px;
    position: relative;
    z-index: 1;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    margin-bottom: 80px;
    padding: 48px 0 0;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-cta {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.2s var(--ease);
    text-decoration: none;
}

.btn-outline:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
    background: var(--accent-dim);
}

/* ===== SECTION LABEL ===== */
.section-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.25));
}

/* ===== CARDS ===== */
.sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-card);
    padding: 32px 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px var(--accent-dim);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 600;
}

.card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 20px;
    max-width: 30ch;
}

.card a {
    margin-top: auto;
    display: inline-block;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s var(--ease);
    opacity: 0.7;
}

.card a:hover {
    color: var(--accent-soft);
    opacity: 1;
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 80px 20px 40px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 32px;
    border: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 24px var(--accent-dim);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.auth-card h1 {
    font-size: 1.4rem;
    text-align: center;
    margin: 0 0 6px;
    font-weight: 700;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0 0 32px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input, textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s var(--ease);
}

textarea {
    display: block;
    min-height: 120px;
    max-height: 400px;
    resize: vertical;
    overflow: auto;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--border-hover);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: rgba(10, 16, 30, 0.9);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Chrome autofill fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-main) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.825rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-link {
    font-size: 0.825rem;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.7;
}

.form-link:hover {
    opacity: 1;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.btn-submit:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: var(--accent-dim);
}

.btn-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.auth-secondary-actions {
    margin-bottom: 20px;
    text-align: center;
}

.auth-link-action {
    display: inline-block;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    opacity: 0.9;
}

.auth-link-action:hover {
    opacity: 1;
    color: var(--accent-soft);
}

.auth-link-action.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(10, 16, 30, 0.4);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: var(--accent-dim);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-helper {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent);
    font-weight: 500;
    opacity: 0.8;
}

.auth-footer a:hover {
    opacity: 1;
}

/* ===== CONTACT PAGE ===== */
.contact-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 80px 20px 40px;
}

.contact-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 32px;
    border: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 24px var(--accent-dim);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.contact-card h1,
.contact-card .auth-subtitle {
    text-align: center;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

button {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-size: 0.85rem;
}

.btn-send, .btn-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-send:hover, .btn-cancel:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: var(--accent-dim);
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #0e1423;
    border: 1px solid var(--border-hover);
    padding: 32px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 380px;
    width: calc(100% - 32px);
    box-shadow: 0 0 32px var(--accent-dim);
}

.modal-content h2 {
    margin: 0 0 8px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.modal-content p {
    color: var(--text-muted);
    margin: 0 0 24px;
    font-size: 0.875rem;
}

.modal-content button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 24px;
    width: auto;
}

.modal-content button:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: var(--accent-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    nav {
        padding: 0 16px;
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        gap: 4px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-brand {
        font-size: 0.9rem;
    }

    .nav-logo {
        width: 24px;
        height: 24px;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 20px;
        margin-left: 0;
    }

    .nav-links a {
        font-size: 0.75rem;
    }

    .nav-auth {
        margin-left: auto;
        gap: 6px;
    }

    .btn-nav {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .container {
        padding-top: 100px;
    }

    .hero {
        margin-bottom: 48px;
        padding: 24px 0 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .sections {
        grid-template-columns: 1fr;
    }

    .auth-card, .contact-card {
        padding: 28px 20px;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 8px 12px;
    }

    .nav-brand {
        font-size: 0.85rem;
    }

    .nav-logo {
        width: 22px;
        height: 22px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.875rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .card {
        padding: 24px 20px;
    }
}
