/* ════════════════════════════════════════════════
   Hidden Admin Login Modal
   Babel Brand: Charcoal + Bronze
   ════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────── */

.admin-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    pointer-events: none;
    transition: background 0.35s ease, backdrop-filter 0.35s ease;
}

.admin-login-overlay.visible {
    background: rgba(26, 25, 23, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
}

/* ── Modal Card ──────────────────────────────── */

.admin-login-modal {
    position: relative;
    width: 90%;
    max-width: 420px;
    background: rgba(42, 41, 34, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 173, 134, 0.2);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow:
        0 16px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(212, 173, 134, 0.08);
    transform: scale(0.92) translateY(16px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
}

.admin-login-overlay.visible .admin-login-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Close Button ────────────────────────────── */

.admin-login-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(212, 173, 134, 0.08);
    border: 1px solid rgba(212, 173, 134, 0.15);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(163, 163, 159, 0.8);
    cursor: pointer;
    transition: all 0.25s ease;
}

.admin-login-close:hover {
    background: rgba(212, 173, 134, 0.15);
    border-color: rgba(212, 173, 134, 0.3);
    color: #F8F8F4;
}

/* ── Step Content ────────────────────────────── */

.admin-login-step {
    text-align: center;
}

.admin-login-step.hidden {
    display: none;
}

.admin-login-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.admin-login-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #F8F8F4;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.admin-login-desc {
    color: #A3A39F;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ── Environment Buttons ─────────────────────── */

.admin-env-buttons {
    display: flex;
    gap: 12px;
}

.admin-env-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 0;
    background: rgba(62, 61, 53, 0.6);
    border: 1px solid rgba(212, 173, 134, 0.15);
    color: #F8F8F4;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.admin-env-btn:hover {
    background: rgba(60, 53, 45, 0.9);
    border-color: #D4AD86;
    box-shadow: 0 0 20px rgba(212, 173, 134, 0.12);
    transform: translateY(-1px);
}

.admin-env-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.admin-env-dot.dev {
    background: #6ABF69;
    box-shadow: 0 0 6px rgba(106, 191, 105, 0.5);
}

.admin-env-dot.prod {
    background: #EF5B5B;
    box-shadow: 0 0 6px rgba(239, 91, 91, 0.5);
}

.admin-env-dot.lambda {
    background: #F5C542;
    box-shadow: 0 0 6px rgba(245, 197, 66, 0.5);
}

.admin-env-btn.selected {
    border-color: #D4AD86;
    background: rgba(60, 53, 45, 0.9);
    box-shadow: 0 0 20px rgba(212, 173, 134, 0.12);
}

.admin-lambda-url.hidden {
    display: none;
}

.admin-env-label {
    color: #D4AD86;
    font-weight: 600;
}

/* ── Form ────────────────────────────────────── */

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-login-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 0;
    background: rgba(62, 61, 53, 0.5);
    border: 1px solid rgba(212, 173, 134, 0.2);
    color: #F8F8F4;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.admin-login-input::placeholder {
    color: #71716F;
}

.admin-login-input:focus {
    border-color: #D4AD86;
    box-shadow: 0 0 0 2px rgba(212, 173, 134, 0.15);
}

.admin-login-input:focus:not(:focus-visible) {
    outline: none;
}

.admin-login-submit {
    width: 100%;
    padding: 14px;
    border-radius: 0;
    background: rgba(60, 53, 45, 1);
    border: 1px solid #D4AD86;
    color: #F8F8F4;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.admin-login-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.admin-login-submit:hover {
    background: #3E3D35;
    border-color: #E2C9A8;
    box-shadow: 0 0 40px rgba(212, 173, 134, 0.15);
    transform: translateY(-1px);
}

.admin-login-submit:hover::before {
    opacity: 1;
}

.admin-login-submit:active {
    transform: translateY(0);
}

/* ── OTP Digit Inputs ────────────────────────── */

.admin-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 4px;
}

.admin-otp-digit {
    width: 48px;
    height: 56px;
    border-radius: 0;
    background: rgba(62, 61, 53, 0.5);
    border: 1px solid rgba(212, 173, 134, 0.2);
    color: #F8F8F4;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    caret-color: #D4AD86;
}

.admin-otp-digit:focus {
    border-color: #D4AD86;
    box-shadow: 0 0 0 2px rgba(212, 173, 134, 0.15);
}

.admin-otp-digit:focus:not(:focus-visible) {
    outline: none;
}

/* ── Back Button ─────────────────────────────── */

.admin-login-back {
    display: inline-block;
    margin-top: 16px;
    background: none;
    border: none;
    color: #71716F;
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    cursor: pointer;
    transition: color 0.25s ease;
}

.admin-login-back:hover {
    color: #D4AD86;
}

/* ── Error Message ───────────────────────────── */

.admin-login-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 0;
    background: rgba(239, 91, 91, 0.08);
    border: 1px solid rgba(239, 91, 91, 0.2);
    color: #EF5B5B;
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    text-align: center;
    line-height: 1.4;
}

.admin-login-error.hidden {
    display: none;
}

/* ── Spinner ─────────────────────────────────── */

.admin-login-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 41, 34, 0.88);
    border-radius: 12px;
    z-index: 10;
}

.admin-login-spinner.hidden {
    display: none;
}

.admin-spinner-ring {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(212, 173, 134, 0.2);
    border-top-color: #D4AD86;
    border-radius: 50%;
    animation: admin-spin 0.8s linear infinite;
}

@keyframes admin-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 480px) {
    .admin-login-modal {
        padding: 32px 20px;
    }

    .admin-env-buttons {
        flex-direction: column;
    }

    .admin-otp-digit {
        width: 40px;
        height: 48px;
        font-size: 1.2rem;
    }
}