/* ClariX auth theme */
:root {
    --auth-bg: #0a0c10;
    --auth-surface: #12151b;
    --auth-surface-alt: #181c24;
    --auth-border: #242a35;
    --auth-text: #edf2f4;
    --auth-text-muted: #94a3b8;
    --auth-primary: #0ea5e9;
    --auth-primary-hover: #0284c7;
    --auth-danger: #ef4444;
    --auth-success: #22c55e;
    --auth-shadow: rgba(0, 0, 0, 0.35);
    --auth-input-bg: #181c24;
}

body.light-mode {
    --auth-bg: #f5f7fa;
    --auth-surface: #ffffff;
    --auth-surface-alt: #f7f9fb;
    --auth-border: #e2e6ec;
    --auth-text: #12151b;
    --auth-text-muted: #5b6b7f;
    --auth-primary: #0ea5e9;
    --auth-primary-hover: #0284c7;
    --auth-danger: #dc2626;
    --auth-success: #16a34a;
    --auth-shadow: rgba(0, 0, 0, 0.08);
    --auth-input-bg: #fafbfc;
}

html,
body {
    min-height: 100vh;
}

body.auth-page {
    margin: 0;
    color: var(--auth-text);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.08), transparent 28%),
        linear-gradient(180deg, var(--auth-bg), #0a0c10 100%);
    font-family: "Inter", system-ui, sans-serif;
}

body.auth-page.light-mode {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.08), transparent 30%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.06), transparent 28%),
        linear-gradient(180deg, #f8fafc, var(--auth-bg) 100%);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    box-shadow: 0 20px 60px var(--auth-shadow);
    overflow: hidden;
}

.auth-card-body {
    padding: 2rem;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-brand {
    display: grid;
    gap: 0.4rem;
}

.clarix-wordmark {
    font-family: 'Sora', system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: var(--auth-text);
}

.clarix-wordmark .clarix-x {
    color: #0ea5e9;
}

.clarix-wordmark-sm { font-size: 1.1rem; }
.clarix-wordmark-md { font-size: 1.4rem; }
.clarix-wordmark-lg { font-size: 2.1rem; }

.clarix-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0ea5e9;
    color: #fff;
    font-family: 'Sora', system-ui, sans-serif;
    font-weight: 900;
    line-height: 1;
}

.clarix-icon-sm { width: 28px; height: 28px; font-size: 0.95rem; border-radius: 7px; }
.clarix-icon-md { width: 40px; height: 40px; font-size: 1.3rem; border-radius: 10px; }
.clarix-icon-lg { width: 64px; height: 64px; font-size: 2rem; border-radius: 16px; }

.auth-title {
    margin: 0;
    color: var(--auth-text);
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
}

.auth-subtitle {
    margin: 0;
    color: var(--auth-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    background: var(--auth-surface-alt);
    color: var(--auth-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-theme-toggle:hover {
    border-color: var(--auth-primary);
    color: white;
    background: var(--auth-primary);
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-form .form-label {
    color: var(--auth-text);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
}

.auth-form .form-control {
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    color: var(--auth-text);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 3.4rem;
}

.password-field .form-control::-ms-reveal,
.password-field .form-control::-ms-clear {
    display: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--auth-text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--auth-primary);
    background: rgba(14, 165, 233, 0.08);
    outline: none;
}

.auth-form .form-control:focus {
    background: var(--auth-input-bg);
    color: var(--auth-text);
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.16);
}

.auth-form .form-control::placeholder {
    color: var(--auth-text-muted);
}

.auth-submit {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 0.95rem 1.2rem;
    background: var(--auth-primary);
    color: #fff;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.auth-submit:hover {
    background: var(--auth-primary-hover);
    transform: translateY(-1px);
}

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

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.invalid-feedback {
    display: block;
}

.auth-notifications .alert {
    border-radius: 14px;
    margin-bottom: 0;
}

@media (max-width: 575px) {
    .auth-card-body {
        padding: 1.5rem;
    }

    .auth-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-theme-toggle {
        align-self: flex-end;
    }
}
