/**
 * ScoutOne Authentication — premium glass UI
 */

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

:root {
    --so-bg: #080b12;
    --so-bg-soft: #0f1420;
    --so-card: rgba(255, 255, 255, 0.06);
    --so-card-border: rgba(255, 255, 255, 0.12);
    --so-text: #f1f5f9;
    --so-text-muted: #94a3b8;
    --so-accent: #6366f1;
    --so-accent-2: #8b5cf6;
    --so-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --so-radius: 20px;
    --so-font: 'Inter', system-ui, sans-serif;
    --so-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --so-danger: #f87171;
    --so-success: #34d399;
    --so-warn: #fbbf24;
}

body.so-auth {
    margin: 0;
    min-height: 100vh;
    font-family: var(--so-font);
    color: var(--so-text);
    background: var(--so-bg);
    -webkit-font-smoothing: antialiased;
}

.so-auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.so-auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.25), transparent 55%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(217, 70, 239, 0.18), transparent 50%),
        linear-gradient(180deg, #080b12 0%, #0f1420 100%);
}

.so-auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: soOrbFloat 18s ease-in-out infinite;
}

.so-auth-orb-1 {
    width: 420px;
    height: 420px;
    background: rgba(99, 102, 241, 0.35);
    top: -120px;
    left: -80px;
}

.so-auth-orb-2 {
    width: 360px;
    height: 360px;
    background: rgba(139, 92, 246, 0.28);
    bottom: -100px;
    right: -60px;
    animation-delay: -6s;
}

@keyframes soOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(24px, -16px) scale(1.05); }
}

.so-auth-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.so-auth-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
}

.so-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--so-text);
    font-weight: 700;
    font-size: 1.15rem;
    transition: opacity 0.2s;
}

.so-auth-logo:hover { opacity: 0.85; }

.so-brand.so-auth-logo .so-brand-wordmark {
    color: var(--so-text);
}

.so-brand.so-auth-logo .so-brand-img-nav {
    width: 34px;
    height: 34px;
}

.so-auth-logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--so-gradient);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
}

.so-auth-logo span.so-gradient-text {
    background: var(--so-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.so-auth-back {
    color: var(--so-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.so-auth-back:hover { color: var(--so-text); }

.so-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--so-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--so-card-border);
    border-radius: var(--so-radius);
    padding: 40px 36px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    animation: soCardIn 0.5s var(--so-ease) both;
    box-sizing: border-box;
}

.so-auth-card-wide { max-width: 520px; }

@keyframes soCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.so-auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.so-auth-header h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.so-auth-header p {
    margin: 0;
    color: var(--so-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.so-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 20px;
}

.so-auth-alert svg { flex-shrink: 0; margin-top: 2px; width: 18px; height: 18px; }

.so-auth-alert-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #fecaca;
}

.so-auth-alert-success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: #a7f3d0;
}

.so-auth-alert-info {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

.so-auth-form { display: flex; flex-direction: column; gap: 18px; }

.so-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.so-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--so-text-muted);
    margin-bottom: 6px;
}

.so-field input[type="text"],
.so-field input[type="email"],
.so-field input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    color: var(--so-text);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.so-field input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.so-field input::placeholder { color: #64748b; }

.so-password-wrap {
    position: relative;
}

.so-password-wrap input { padding-right: 44px; }

.so-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--so-text-muted);
    cursor: pointer;
    padding: 4px;
    display: grid;
    place-items: center;
    transition: color 0.2s;
}

.so-password-toggle:hover { color: var(--so-text); }

.so-password-strength {
    margin-top: 8px;
}

.so-strength-bar {
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.so-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 0.3s var(--so-ease), background 0.3s;
}

.so-strength-label {
    font-size: 0.75rem;
    color: var(--so-text-muted);
    margin-top: 4px;
}

.so-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.so-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--so-text-muted);
    cursor: pointer;
    line-height: 1.4;
}

.so-checkbox input {
    margin-top: 3px;
    accent-color: var(--so-accent);
}

.so-checkbox a { color: #a5b4fc; }

.so-auth-forgot {
    font-size: 0.8125rem;
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
}

.so-auth-forgot:hover { text-decoration: underline; }

.so-btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s var(--so-ease), box-shadow 0.2s, opacity 0.2s;
    box-sizing: border-box;
}

.so-btn-auth-primary {
    background: var(--so-gradient);
    color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.so-btn-auth-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.45);
}

.so-btn-auth-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.so-btn-auth-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--so-text);
    border: 1px solid var(--so-card-border);
    text-decoration: none;
}

.so-btn-auth-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.so-auth-footer a {
    color: #a5b4fc;
    font-weight: 600;
    text-decoration: none;
}

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

.so-promo-preview {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.8125rem;
    display: none;
    border: 1px solid rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.08);
    color: #a7f3d0;
}

.so-promo-preview.visible { display: block; }
.so-promo-preview.error {
    border-color: rgba(248, 113, 113, 0.25);
    background: rgba(248, 113, 113, 0.08);
    color: #fecaca;
}

.so-auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: soSpin 0.7s linear infinite;
    display: none;
}

.so-btn-auth.loading .so-auth-spinner { display: block; }
.so-btn-auth.loading .so-btn-label { opacity: 0.7; }

@keyframes soSpin { to { transform: rotate(360deg); } }

/* Status pages */
.so-status-card {
    text-align: center;
    max-width: 480px;
}

.so-status-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    margin: 0 auto 24px;
}

.so-status-icon svg { width: 32px; height: 32px; }

.so-status-icon-pending {
    background: rgba(251, 191, 36, 0.15);
    color: var(--so-warn);
}

.so-status-icon-suspended,
.so-status-icon-rejected,
.so-status-icon-forbidden {
    background: rgba(248, 113, 113, 0.15);
    color: var(--so-danger);
}

.so-status-icon-expired {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.so-status-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 28px;
}

.so-plan-hint {
    font-size: 0.75rem;
    color: var(--so-text-muted);
    margin: -6px 0 0;
}

.so-auth-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
}

.so-auth-benefits span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.22);
    color: #c7d2fe;
    font-size: 0.75rem;
    font-weight: 600;
}

.so-auth-benefits svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 520px) {
    .so-auth-card {
        width: 100%;
        max-width: 100%;
        padding: 28px 22px;
        border-radius: 20px;
        box-sizing: border-box;
    }
    .so-auth-row { grid-template-columns: 1fr; }
    .so-auth-nav {
        padding: 16px 24px;
        gap: 12px;
    }
    .so-auth-back {
        font-size: 0.8rem;
        white-space: nowrap;
    }
    .so-auth-header h1 { font-size: 1.45rem; }
    .so-auth-wrap {
        padding: 88px 24px 40px;
        box-sizing: border-box;
    }
    .so-btn-auth {
        min-height: 48px;
        font-size: 15px;
    }
    .so-auth-form input:not([type="checkbox"]):not([type="radio"]),
    .so-auth-form select {
        min-height: 46px;
        font-size: 16px;
    }
    .so-auth-options {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .so-checkbox {
        align-items: center;
    }
    .so-checkbox input {
        margin-top: 0;
        width: 18px;
        height: 18px;
        min-height: 0;
        flex-shrink: 0;
    }
    .so-auth-benefits {
        gap: 6px;
    }
    .so-auth-benefits span {
        font-size: 0.7rem;
        padding: 6px 10px;
    }
}

.so-auth-alert-error span a {
    color: #fecaca;
    text-decoration: underline;
}

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

.so-auth-divider::before,
.so-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}
