/* ==========================================================================
   BIVACO SPLIT-SCREEN AUTH MODAL (LEFT 1 IMAGE + RIGHT FORM)
   ========================================================================== */

/* 1. Backdrop Overlay */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 20, 28, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 2. Dialog Container */
.auth-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 870px;
    transform: translateY(22px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
}

.auth-modal-overlay.is-active .auth-modal-dialog {
    transform: translateY(0) scale(1);
}

/* 3. Split-Screen Card */
.auth-modal-card-split {
    background: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 32px 85px -15px rgba(10, 18, 30, 0.42),
                0 0 0 1px rgba(164, 122, 61, 0.22);
    overflow: hidden;
    display: flex;
    max-height: min(92vh, 690px);
    position: relative;
}

/* ==========================================================================
   LEFT COLUMN: FULL PHOTO IMAGE (100% COVER)
   ========================================================================== */
.auth-modal-visual-image {
    width: 370px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: #171410;
    border-right: 1px solid rgba(164, 122, 61, 0.16);
    padding: 0 !important;
}

.auth-visual-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.auth-visual-cover-img.is-active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-dialog:hover .auth-visual-cover-img.is-active {
    transform: scale(1.03);
}

/* Subtle Glassmorphism Brand Tag Overlay on Image */
.auth-visual-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 18, 24, 0.45) 30%, rgba(15, 18, 24, 0.88) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 2;
}

.auth-visual-overlay-brand {
    display: flex;
    align-items: center;
}

.auth-overlay-logo {
    max-height: 32px;
    max-width: 130px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.auth-visual-overlay-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(164, 122, 61, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #F8E2AC;
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.auth-visual-overlay-badge .material-symbols-outlined {
    font-size: 13px;
    color: #F8E2AC;
}

/* ==========================================================================
   RIGHT COLUMN: FORMS & TABS
   ========================================================================== */
.auth-modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #F4EFE6;
    border: 1px solid rgba(164, 122, 61, 0.2);
    color: #5C431B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
    padding: 0;
}

.auth-modal-close .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
}

.auth-modal-close:hover {
    background: #A47A3D;
    color: #FFFFFF;
    border-color: #A47A3D;
    transform: rotate(90deg);
}

/* Mobile brand strip fallback */
.auth-mobile-header {
    display: none;
    padding: 14px 18px 10px;
    background: #FAF7F2;
    border-bottom: 1px solid #ECE4D7;
}

.auth-mobile-brand-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.auth-mobile-logo {
    max-height: 32px;
    max-width: 130px;
    object-fit: contain;
}

.auth-mobile-badge {
    padding: 3px 8px;
    background: #A47A3D;
    color: #FFF;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

/* Right Header & Heading */
.auth-modal-header {
    padding: 26px 30px 12px;
}

.auth-modal-heading-text {
    margin-bottom: 14px;
}

.auth-modal-heading-text h4 {
    margin: 0 0 4px 0;
    color: #241D14;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.auth-modal-heading-text p {
    margin: 0;
    color: #7A6F60;
    font-size: 13.5px;
}

/* Dual Segmented Tabs */
.auth-modal-tabs {
    display: flex;
    background: #F4EFE6;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border: 1px solid rgba(164, 122, 61, 0.12);
}

.auth-tab-btn {
    flex: 1;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #7A6953;
    border: none;
    background: transparent;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-tab-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.auth-tab-btn.is-active {
    background: #FFFFFF;
    color: #A47A3D;
    box-shadow: 0 4px 12px rgba(164, 122, 61, 0.15);
}

/* Body & Form */
.auth-modal-body {
    padding: 16px 30px 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1;
}

/* Tab Panes */
.auth-modal-pane {
    display: none;
    animation: authPaneFade 0.25s ease forwards;
}

.auth-modal-pane.is-active {
    display: block;
}

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

/* Form Groups & Labels */
.auth-modal-form .form-group {
    margin-bottom: 14px;
}

.auth-field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #4A3E2D;
    margin-bottom: 5px;
}

.auth-field-label .req {
    color: #DC2626;
    margin-left: 2px;
}

.auth-modal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Input Fields */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid #E4DCD0;
    background: #FAF8F5;
    border-radius: 11px;
    padding: 0 13px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    min-height: 45px;
}

.auth-input-wrap:focus-within {
    border-color: #A47A3D;
    background: #FFFFFF;
    box-shadow: 0 0 0 3.5px rgba(164, 122, 61, 0.15);
}

.auth-input-wrap.has-error {
    border-color: #DC2626;
    background: #FFFBFB;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-input-icon {
    color: #A47A3D;
    font-size: 20px;
    line-height: 1;
    margin-right: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.auth-input-wrap input {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #2D2821;
    height: 43px;
    padding: 0;
    font-family: inherit;
}

.auth-input-wrap input::placeholder {
    color: #A29A8F;
    font-size: 13.5px;
}

/* Password Eye Toggle */
.auth-toggle-pwd {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8C8273;
    transition: color 0.2s;
    margin-left: 6px;
}

.auth-toggle-pwd:hover {
    color: #A47A3D;
}

.auth-toggle-pwd svg {
    display: block;
}

/* Actions Row */
.auth-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 16px;
    font-size: 13px;
}

.auth-remember-lbl {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    color: #5C5242;
    user-select: none;
    font-size: 13px;
}

.auth-remember-lbl input[type="checkbox"] {
    accent-color: #A47A3D;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.auth-forgot-link {
    color: #A47A3D;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-forgot-link:hover {
    color: #87612B;
    text-decoration: underline;
}

/* Submit CTA Button with Gold Shimmer */
.auth-submit-btn {
    width: 100%;
    min-height: 48px;
    background: linear-gradient(135deg, #B88A42 0%, #9C6F2A 50%, #825B1D 100%);
    color: #FFFFFF !important;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(164, 122, 61, 0.28);
    transition: all 0.28s ease;
    padding: 11px 20px;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, #C7984E 0%, #AB7C34 50%, #8D6423 100%);
    box-shadow: 0 8px 24px rgba(164, 122, 61, 0.38);
    transform: translateY(-1px);
}

.auth-submit-btn:hover::after {
    left: 120%;
}

.auth-submit-btn:hover .auth-btn-arrow {
    transform: translateX(4px);
}

.auth-btn-arrow {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Spinner in submit button */
.auth-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
}

.auth-submit-btn.is-loading .auth-btn-spinner {
    display: inline-block;
}

.auth-submit-btn.is-loading .auth-btn-arrow {
    display: none;
}

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

/* Footer Switch */
.auth-modal-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: #6D6353;
}

.auth-switch-tab {
    color: #A47A3D;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    margin-left: 4px;
    transition: color 0.2s;
}

.auth-switch-tab:hover {
    color: #87612B;
    text-decoration: underline;
}

/* Alert Box */
.auth-modal-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    display: none;
}

.auth-modal-alert.is-show {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.auth-modal-alert-danger {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.auth-modal-alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

.auth-modal-alert .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Body lock when modal open */
body.auth-modal-open {
    overflow: hidden !important;
    padding-right: var(--scrollbar-width, 0px);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 820px) {
    .auth-modal-dialog {
        max-width: 490px;
    }

    .auth-modal-card-split {
        flex-direction: column;
        max-height: calc(100vh - 24px);
        border-radius: 20px;
    }

    /* On mobile, show image as a compact top banner */
    .auth-modal-visual-image {
        width: 100%;
        height: 130px;
        flex-shrink: 0;
        border-right: none;
        border-bottom: 1px solid rgba(164, 122, 61, 0.16);
    }

    .auth-visual-image-overlay {
        padding: 10px 16px;
        background: linear-gradient(180deg, transparent 0%, rgba(15, 18, 24, 0.8) 100%);
    }

    .auth-overlay-logo {
        max-height: 26px;
    }

    .auth-mobile-header {
        display: none;
    }

    .auth-modal-header {
        padding: 16px 20px 8px;
    }

    .auth-modal-heading-text h4 {
        font-size: 19px;
    }

    .auth-modal-body {
        padding: 12px 20px 22px;
    }

    .auth-modal-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .auth-modal-overlay {
        padding: 8px;
    }

    .auth-modal-card-split {
        border-radius: 18px;
        max-height: calc(100vh - 16px);
    }

    .auth-modal-visual-image {
        height: 260px;
    }

    .auth-modal-header {
        padding: 14px 16px 8px;
    }

    .auth-modal-body {
        padding: 10px 16px 18px;
    }

    .auth-modal-close {
        top: 10px;
        right: 10px;
    }
}
