/* =============================================
   Login — 2-step flow (email -> password)
   Only the bits Bootstrap doesn't already cover:
   step show/hide + transition, invalid-email shake,
   the "email chip" in step 2, and the language switcher.
   ============================================= */

/* ---------- Language Switcher ---------- */
.login-lang-switcher {
    position: fixed;
    top: max(16px, env(safe-area-inset-top, 0px));
    right: max(20px, env(safe-area-inset-right, 0px));
    z-index: 1050;
}

.login-lang-switcher .btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.login-lang-switcher .btn-lang i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.login-lang-switcher .btn-lang:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    transform: translateY(-1px);
}

.login-lang-switcher .btn-lang:hover i {
    transform: rotate(20deg);
}

.login-lang-switcher .btn-lang:active {
    transform: translateY(0);
}

.login-lang-switcher .btn-lang:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

@media (max-width: 576px) {
    .login-lang-switcher {
        top: max(10px, env(safe-area-inset-top, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
    }
}

.login-step {
    display: none;
    animation: loginStepFadeIn 0.25s ease-out both;
}

.login-step.active {
    display: block;
}

@keyframes loginStepFadeIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Shake the email field when the account isn't found / format is invalid */
.login-input-group.shake .form-control {
    animation: loginShake 0.4s ease-out;
    border-color: var(--bs-danger, #dc3545);
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Email chip shown in step 2, click to go back and change the email */
.login-email-chip {
    appearance: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    background: #f4f5f7;
    border: 1px solid #e0e3e8;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.88rem;
    color: var(--color-primary, #396743);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    margin-bottom: 1rem;
    animation: loginChipIn 0.3s ease-out both;
}

.login-email-chip:hover,
.login-email-chip:focus-visible {
    background: #fff;
    border-color: var(--color-primary, #396743);
}

.login-email-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}

.login-email-chip-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

@keyframes loginChipIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* Mary's Tamales: restrained color-only branding */
.bg-primary-light {
    background-color: rgba(57, 103, 67, 0.10) !important;
}
.auth-brand .brand-logo-full {
    width: 140px;
    height: 140px;
}
