/* ============================================================
   AUTH FORMS REDESIGN — Premium · Calm · Creative
   A luxurious split-panel authentication layout that speaks the
   same design language as the home page — refined, thoughtful,
   and elegant. All form field IDs, names, validation hooks,
   and JS remain untouched.
   ============================================================ */

/* ---- Page shell ---- */
.auth-container.auth-redesign {
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f8fafc);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.auth-container.auth-redesign::before {
    display: none;
}

/* ---- Creative background: soft brand glows + dot texture ---- */
.auth-container.auth-redesign .auth-bg-grid,
.auth-container.auth-redesign .auth-aurora {
    display: none;
}

/* ---- Refined card ---- */
.auth-redesign .auth-card {
    max-width: 920px;
    width: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    z-index: 1;
}

.auth-redesign .auth-card::before {
    display: none;
}

/* ---- Brand panel ---- */
.auth-brand {
    position: relative;
    padding: 3rem 2.5rem;
    color: #ffffff;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
    overflow: hidden;
    isolation: isolate;
    border-right: 1px solid #1e293b;
}

.auth-brand::before,
.auth-brand::after,
.auth-brand-glow {
    display: none !important;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.auth-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.auth-brand-logo i {
    font-size: 1.35rem;
    color: #ffffff;
    background: none;
    -webkit-text-fill-color: initial;
}

.auth-brand-heading {
    font-size: clamp(1.6rem, 2.2vw, 2.1rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 1.5rem 0 0.6rem;
    letter-spacing: -0.5px;
    color: #ffffff;
    background: none;
    -webkit-text-fill-color: initial;
}

.auth-brand-text {
    font-size: 0.92rem;
    color: #94a3b8;
    line-height: 1.6;
    max-width: 34ch;
    margin: 0;
}

.auth-brand-features {
    list-style: none;
    padding: 0;
    margin: 1.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-brand-features li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    transform: none;
    box-shadow: none;
}

.auth-brand-features li i {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: #ffffff;
    transition: background-color 0.2s ease;
}

.auth-brand-features li:hover i {
    background: #818cf8;
    border-color: #818cf8;
    transform: none;
}

.auth-brand-footnote {
    margin-top: 1.75rem;
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 700;
}

/* ---- Form panel ---- */
.auth-panel {
    padding: 2.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    max-height: 92vh;
    background: #ffffff;
}

.auth-redesign .auth-header {
    text-align: left !important;
    margin-bottom: 1.25rem !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.auth-redesign .auth-header::before,
.auth-redesign .auth-header::after {
    display: none !important;
}

.auth-redesign .auth-header .auth-logo {
    display: none !important;
}

.auth-redesign .auth-title {
    font-size: 1.625rem !important;
    text-align: left !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    background: none !important;
    margin: 0 !important;
}

.auth-panel-subtitle {
    color: #64748b !important;
    font-size: 0.95rem !important;
    margin-top: 0.3rem !important;
}

/* ---- Flat floating inputs ---- */
.auth-redesign .auth-form-group {
    margin-bottom: 1rem;
}

.auth-redesign .auth-form-floating .form-control {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.05rem 1rem 0.85rem;
    font-size: 0.95rem;
    background: #f8fafc;
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    min-height: 52px;
    color: #0f172a;
}

.auth-redesign .auth-form-floating .form-control::placeholder {
    color: transparent !important;
    opacity: 0 !important;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.auth-redesign .auth-form-floating .form-control:focus::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

.auth-redesign .auth-form-floating .form-control:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.auth-redesign .auth-form-floating .form-control:focus {
    background: #ffffff;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
    transform: none;
    outline: none;
}

.auth-redesign .auth-form-floating label {
    background: transparent;
    left: 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 450;
    padding: 0 2px;
}

.auth-redesign .auth-form-floating .form-control:focus ~ label,
.auth-redesign .auth-form-floating .form-control:not(:placeholder-shown) ~ label,
.auth-redesign .auth-form-floating .form-control:-webkit-autofill ~ label {
    top: 0 !important;
    transform: translateY(-50%) scale(0.82) !important;
    padding: 0 6px !important;
    color: #334155 !important;
    font-weight: 500 !important;
    background: #f8fafc !important;
    z-index: 10 !important;
}

.auth-redesign .auth-form-floating .form-control:focus ~ label {
    color: #818cf8 !important;
    background: #ffffff !important;
}

/* RTL label support */
[dir="rtl"] .auth-redesign .auth-form-floating label {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .auth-redesign .auth-form-icon,
[dir="rtl"] .auth-redesign .auth-password-toggle {
    right: auto;
    left: 0.9rem;
}

/* Icon positioning */
.auth-redesign .auth-form-icon,
.auth-redesign .auth-password-toggle {
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ---- Validation states ---- */
.auth-redesign .auth-form-floating .form-control.is-valid {
    border-color: #059669;
    background-image: none;
}

.auth-redesign .auth-form-floating .form-control.is-invalid {
    border-color: #dc2626;
    padding-right: 2.5rem;
    background-image: none;
}

.auth-redesign .auth-form-floating .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-redesign .auth-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ---- Flat button ---- */
.auth-redesign .auth-button {
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: #818cf8;
    color: #ffffff;
    box-shadow: none;
    transition: background-color 0.2s ease;
    letter-spacing: 0.2px;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-redesign .auth-button::before,
.auth-redesign .auth-button::after {
    display: none !important;
}

.auth-redesign .auth-button:hover {
    background: #6366f1;
    transform: none;
    box-shadow: none;
}

.auth-redesign .auth-button:active {
    transform: none;
}

.auth-redesign .auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ---- Progress bar ---- */
.auth-redesign .auth-progress .bg-gradient-to-r {
    background: #818cf8 !important;
}

.auth-redesign .auth-progress-text {
    font-size: 0.82rem;
}

/* ---- Footer ---- */
.auth-redesign .auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.auth-redesign .auth-footer .auth-link {
    font-size: 0.88rem;
    position: relative;
    color: #818cf8 !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: color 0.2s ease;
    display: inline-block;
}

.auth-redesign .auth-footer .auth-link::after {
    display: none;
}

.auth-redesign .auth-footer .auth-link:hover {
    color: #6366f1 !important;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .auth-container.auth-redesign {
        padding: 1rem;
    }

    .auth-redesign .auth-card {
        grid-template-columns: 1fr;
        max-width: 430px;
        border-radius: 20px;
    }

    .auth-brand {
        display: none;
    }

    .auth-panel {
        max-height: none;
        padding: 1.75rem;
    }
}

@media (max-width: 576px) {
    .auth-container.auth-redesign {
        padding: 0.75rem;
    }

    .auth-panel {
        padding: 1.5rem;
    }

    .auth-redesign .auth-title {
        font-size: 1.4rem;
    }

    .auth-redesign .auth-form-floating .form-control {
        min-height: 50px;
        padding: 0.95rem 0.85rem 0.8rem;
    }

    .auth-redesign .auth-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

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

.auth-scale-in {
    animation: scaleInCard 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes scaleInCard {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Staggered entrance animation for form controls */
.auth-panel > * {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-panel > *:nth-child(1) { animation-delay: 0.05s; }
.auth-panel > *:nth-child(2) { animation-delay: 0.12s; }
.auth-panel > *:nth-child(3) { animation-delay: 0.18s; }
.auth-panel > *:nth-child(4) { animation-delay: 0.24s; }
.auth-panel > *:nth-child(5) { animation-delay: 0.30s; }
.auth-panel > *:nth-child(6) { animation-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
    .auth-container.auth-redesign .auth-aurora span,
    .auth-brand::before,
    .auth-redesign .auth-button::after,
    .auth-scale-in,
    .auth-panel > * {
        animation: none !important;
    }
}
