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

:root {
    --auth-bg: color-mix(in srgb, var(--primary-color) 4%, #f8fafc);
    --auth-surface: #ffffff;
    --auth-surface-soft: color-mix(in srgb, var(--primary-color) 4%, #ffffff);
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: color-mix(in srgb, var(--primary-color) 12%, #dbe3ef);
    --auth-accent: var(--primary-color);
    --auth-accent-soft: color-mix(in srgb, var(--primary-color) 14%, transparent);
    --auth-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --auth-radius: 18px;
}

[data-theme="dark"] {
    --auth-bg: color-mix(in srgb, var(--primary-color) 5%, #0f172a);
    --auth-surface: #111827;
    --auth-surface-soft: color-mix(in srgb, var(--primary-color) 8%, #111827);
    --auth-text: #f8fafc;
    --auth-muted: #cbd5e1;
    --auth-border: color-mix(in srgb, var(--primary-color) 18%, #334155);
    --auth-accent-soft: color-mix(in srgb, var(--primary-color) 18%, transparent);
    --auth-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--primary-color) 12%, transparent), transparent 30%),
        radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--primary-color) 8%, transparent), transparent 26%),
        linear-gradient(180deg, color-mix(in srgb, var(--primary-color) 3%, #ffffff) 0%, var(--auth-bg) 100%);
    color: var(--auth-text);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input {
    font: inherit;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    position: relative;
    background: var(--auth-surface);
    border: 1px solid rgba(219, 227, 239, 0.85);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--auth-shadow);
}

.auth-header {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.auth-logo .logo {
    width: 132px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
}

/* Light/dark logo switching for auth pages */
.logo-light {
    display: inline-block;
}

.logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: inline-block;
}

.auth-logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--auth-text);
}

.title {
    margin: 0;
    font-size: 30px;
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.description {
    margin: 0 auto;
    max-width: 32ch;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.65;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form-grid {
    display: grid;
    gap: 14px;
}

.auth-form-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-muted);
}

.form-control {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--auth-border);
    background: var(--auth-surface-soft);
    color: var(--auth-text);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    border-color: var(--auth-accent);
    background: #fff;
    box-shadow: 0 0 0 4px var(--auth-accent-soft);
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.input-group > .form-control {
    flex: 1 1 200px;
}

.captcha-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px dashed color-mix(in srgb, var(--auth-accent) 28%, var(--auth-border));
    background: color-mix(in srgb, var(--auth-accent) 6%, transparent);
    color: var(--auth-text);
    font-weight: 700;
    letter-spacing: 0.22em;
}

.captcha-refresh,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--auth-border);
    background: #fff;
    color: var(--auth-text);
    cursor: pointer;
}

.auth-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.remember-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--auth-muted);
}

.remember-wrap input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
}

.auth-terms {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.65;
}

.auth-terms-link,
.auth-footer-link {
    color: var(--auth-accent);
    font-weight: 600;
}

.auth-btn {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--auth-accent), color-mix(in srgb, var(--auth-accent) 65%, #000));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--auth-accent) 25%, transparent);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px color-mix(in srgb, var(--auth-accent) 32%, transparent);
}

.auth-btn:active {
    transform: translateY(0);
    opacity: 0.95;
}

.auth-footer {
    display: flex;
    justify-content: center;
    margin-top: 4px;
    text-align: center;
}

.auth-footer-line {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-animate {
    animation: authFadeUp 0.5s ease both;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .auth-container {
        padding: 18px 12px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .title {
        font-size: 26px;
    }

    .auth-form-grid--2 {
        grid-template-columns: 1fr;
    }

    .auth-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-logo .logo {
        width: 118px;
    }
}
