/* ============================================================
   GestImmo — Auth Pages Stylesheet (Phase 3B)
   Password strength, form states, auth-specific animations
   ============================================================ */

/* ============================================================
   1. Password Strength Meter
   ============================================================ */
.password-meter {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
    margin-bottom: var(--space-3);
}

.password-meter__bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.password-meter__bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: var(--border-color);
    transition: background var(--transition-fast), opacity var(--transition-fast);
}

.password-meter__label {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
    transition: color var(--transition-fast);
}

/* ============================================================
   2. Password Requirement Checks
   ============================================================ */
.password-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-1) var(--space-4);
    margin-bottom: var(--space-2);
}

.password-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.password-check__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.password-check.is-valid {
    color: var(--color-success-600);
}
.password-check.is-valid .password-check__icon {
    color: var(--color-success-500);
}

.password-check.is-invalid {
    color: var(--text-tertiary);
}
.password-check.is-invalid .password-check__icon {
    color: var(--border-color-strong);
}

[data-theme="dark"] .password-check.is-valid {
    color: #6ee7b7;
}

/* ============================================================
   3. Form Valid State
   ============================================================ */
.form-input.is-valid,
.form-select.is-valid,
.form-textarea.is-valid {
    border-color: var(--color-success-500);
}
.form-input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* ============================================================
   4. Form Shake Animation (failed login)
   ============================================================ */
.form-shake {
    animation: formShake 0.4s ease-in-out;
}

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

/* ============================================================
   5. Auth Layout Enhancements
   ============================================================ */

/* Floating particles/decorations on auth right panel */
.auth-layout__right::after {
    content: '';
    position: absolute;
    top: 10%;
    right: -50px;
    width: 250px;
    height: 250px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

.auth-layout__right-content::before {
    content: '';
    position: absolute;
    bottom: 15%;
    left: -30px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-2xl);
    transform: rotate(15deg);
    pointer-events: none;
}

/* Feature list in right panel */
.auth-features {
    margin-top: var(--space-10);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.auth-feature__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}
.auth-feature__icon svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.auth-feature__text h4 {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: #fff;
    margin-bottom: var(--space-1);
}
.auth-feature__text p {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.5);
    line-height: var(--leading-normal);
}

/* ============================================================
   6. Auth Card Fade-in Animation
   ============================================================ */
.auth-card {
    animation: authCardIn 0.5s ease-out;
}

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

/* Right panel content stagger */
.auth-layout__right-content {
    animation: authRightIn 0.7s ease-out 0.2s both;
}

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

/* ============================================================
   7. Social/Divider (for future OAuth)
   ============================================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ============================================================
   8. Terms & Legal Links
   ============================================================ */
.auth-legal {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-align: center;
    margin-top: var(--space-6);
    line-height: var(--leading-loose);
}
.auth-legal a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.auth-legal a:hover {
    color: var(--text-primary);
}

/* ============================================================
   9. Responsive adjustments
   ============================================================ */
@media (max-width: 768px) {
    .password-checks {
        grid-template-columns: 1fr;
    }

    .auth-features {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-card__title {
        font-size: var(--text-xl);
    }
    .auth-card__logo-name {
        font-size: var(--text-xl);
    }
}
