/*
 * ═══════════════════════════════════════════════════════
 *  DWIJA Diamond — Authentication Modal
 *  Rose Gold Luxury Theme (matches home.css)
 * ═══════════════════════════════════════════════════════
 */

:root {
    --am-rosegold: #B76E79;
    --am-rosegold-light: #D4A0A7;
    --am-rosegold-bright: #C9858E;
    --am-rosegold-deep: #8E5158;
    --am-rosegold-pale: #E8C4C9;
    --am-cream: #FFF8F4;
    --am-pearl: #FFFAF7;
    --am-rose-mist: #F9EDEA;
    --am-champagne: #F5E0DA;
    --am-night: #1E1618;
    --am-charcoal: #2D2424;
    --am-ink: #3A2E2E;
    --am-text: #4A3C3C;
    --am-muted: #8A7A7A;
    --am-text-muted: #A09090;
    --am-white: #FFFFFF;
    --am-line: #EBD8D0;
    --am-line-light: #F2E6E0;
    --am-radius: 20px;
    --am-radius-sm: 12px;
    --am-radius-pill: 999px;
    --am-success: #1E8449;
    --am-danger: #C0392B;
}

/* ═══════════════════════════════════════════════════════
   LAYERING  (modal above sticky header 1049 + mobile menu 9999)
   ═══════════════════════════════════════════════════════ */
.auth-modal-wrapper.modal-wrapper.show {
    z-index: 50000 !important;
    background-color: rgba(30, 22, 24, 0.55) !important;
    backdrop-filter: blur(4px);
}
.modal-backdrop.show {
    z-index: 49999 !important;
    background-color: transparent !important;
    opacity: 0 !important;
}

/* ═══════════════════════════════════════════════════════
   DIALOG SHELL  (override base fixed height / 86% width / padding)
   ═══════════════════════════════════════════════════════ */
#authModal .modal-dialog {
    max-width: 900px;
    width: calc(100% - 32px);
    margin: 1.75rem auto;
}

#authModal .modal-content {
    height: auto !important;
    max-height: 92vh;
    padding: 0 !important;
    border: 0;
    border-radius: var(--am-radius);
    background: var(--am-white) !important;
    box-shadow: 0 40px 90px rgba(30, 22, 24, 0.4);
    overflow: hidden !important;
    animation: am-pop 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes am-pop {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

#authModal .modal-body {
    padding: 0 !important;
}

/* Close button */
#authModal .auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    opacity: 1;
    text-shadow: none;
    transition: all 0.3s ease;
}
#authModal .auth-modal__close:hover {
    background: var(--am-rosegold);
    border-color: var(--am-rosegold);
    color: #ffffff;
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════
   TWO-COLUMN INNER  (override base border-bottom + padding)
   ═══════════════════════════════════════════════════════ */
#authModal .auth-modal__inner {
    display: flex;
    align-items: stretch;
    padding: 0 !important;
    margin: 0;
    border: 0 !important;
    max-height: 92vh;
}

/* ── Decorative aside ── */
#authModal .auth-modal__aside {
    position: relative;
    flex: 0 0 42%;
    max-width: 42%;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 18%, rgba(183, 110, 121, 0.55), transparent 42%),
        radial-gradient(circle at 15% 88%, rgba(212, 160, 167, 0.4), transparent 46%),
        linear-gradient(155deg, #2D2424 0%, #4A2E33 48%, #8E5158 100%);
}

#authModal .auth-modal__aside::after {
    /* subtle diamond-facet sheen */
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 46%, rgba(255, 255, 255, 0.06) 50%, transparent 54%),
        linear-gradient(60deg, transparent 60%, rgba(232, 196, 201, 0.08) 64%, transparent 68%);
    pointer-events: none;
}

#authModal .auth-modal__aside-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 52px 44px;
}

#authModal .auth-modal__aside-tag {
    display: inline-block;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(232, 196, 201, 0.35);
    color: var(--am-rosegold-pale);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

#authModal .auth-modal__aside-title {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: 30px;
    font-weight: 300;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

#authModal .auth-modal__aside-text {
    margin: 0 0 30px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.75;
}

#authModal .auth-modal__aside-perks {
    margin: 0;
    padding: 0;
    list-style: none;
}
#authModal .auth-modal__aside-perks li {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
}
#authModal .auth-modal__aside-perks li:last-child { margin-bottom: 0; }
#authModal .auth-modal__aside-perks i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(232, 196, 201, 0.3);
    border-radius: 50%;
    background: rgba(183, 110, 121, 0.28);
    color: var(--am-rosegold-pale);
    font-size: 14px;
}

/* ── Form panel ── */
#authModal .auth-modal__panel {
    flex: 1 1 58%;
    min-width: 0;
    max-height: 92vh;
    overflow-y: auto;
    padding: 46px 46px 40px;
    background: linear-gradient(180deg, var(--am-pearl) 0%, var(--am-white) 30%);
    scrollbar-width: thin;
    scrollbar-color: var(--am-rosegold-pale) transparent;
}
#authModal .auth-modal__panel::-webkit-scrollbar { width: 6px; }
#authModal .auth-modal__panel::-webkit-scrollbar-thumb {
    background: var(--am-rosegold-pale);
    border-radius: var(--am-radius-pill);
}

#authModal .auth-modal__brand {
    margin-bottom: 22px;
    text-align: center;
}
#authModal .auth-modal__brand-name {
    color: var(--am-rosegold-deep);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════ */
#authModal .auth-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 26px;
    padding: 5px;
    border: 1px solid var(--am-line);
    border-radius: var(--am-radius-pill);
    background: var(--am-rose-mist);
}
#authModal .auth-tabs .nav-item { margin: 0; flex: 1 1 0; min-width: 0; }
#authModal .auth-tabs .nav-link {
    display: block;
    padding: 11px 18px;
    border: 0;
    border-radius: var(--am-radius-pill);
    background: transparent;
    color: var(--am-muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#authModal .auth-tabs .nav-link:hover {
    color: var(--am-rosegold-deep);
}
#authModal .auth-tabs .nav-link.active {
    background: var(--am-rosegold);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(183, 110, 121, 0.28);
}

/* ── Panel heading ── */
#authModal .auth-panel-head {
    margin-bottom: 24px;
}
#authModal .auth-panel-title {
    margin: 0 0 6px;
    color: var(--am-charcoal);
    font-size: 24px;
    font-weight: 300;
    letter-spacing: -0.01em;
}
#authModal .auth-panel-subtitle {
    margin: 0;
    color: var(--am-muted);
    font-size: 14px;
    font-weight: 400;
}

/* ═══════════════════════════════════════════════════════
   FORM FIELDS
   ═══════════════════════════════════════════════════════ */
#authModal .auth-form { max-width: 100%; margin: 0; }

#authModal .auth-form .form-group { margin-bottom: 18px; }

#authModal .auth-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--am-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#authModal .auth-form label .text-danger { color: var(--am-rosegold) !important; }

#authModal .auth-form .form-control {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--am-line);
    border-radius: var(--am-radius-sm);
    background: var(--am-pearl);
    color: var(--am-charcoal);
    font-size: 15px;
    box-shadow: none;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
#authModal .auth-form .form-control::placeholder { color: var(--am-text-muted); }
#authModal .auth-form .form-control:focus {
    border-color: var(--am-rosegold);
    background: var(--am-white);
    box-shadow: 0 0 0 4px rgba(183, 110, 121, 0.12);
    outline: none;
}

#authModal .auth-form .form-text {
    margin-top: 6px;
    color: var(--am-text-muted) !important;
    font-size: 12px;
}

/* Password toggle */
#authModal .password-wrapper { position: relative; }
#authModal .password-wrapper .password-input { padding-right: 46px; }
#authModal .password-wrapper .toggle-password {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: var(--am-muted);
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s ease;
}
#authModal .password-wrapper .toggle-password:hover { color: var(--am-rosegold); }

/* Validation */
#authModal .auth-form .form-control.is-invalid {
    border-color: var(--am-danger);
    background: #fff6f4;
}
#authModal .invalid-feedback {
    margin-top: 6px;
    color: var(--am-danger);
    font-size: 12.5px;
    font-weight: 500;
}

/* Remember-me + forgot row */
#authModal .auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* Custom checkbox */
#authModal .custom-control { min-height: auto; }
#authModal .custom-checkbox .custom-control-label {
    margin: 0;
    padding-left: 6px;
    color: var(--am-text);
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
#authModal .custom-checkbox .custom-control-label::before {
    top: 2px;
    width: 18px;
    height: 18px;
    border: 1px solid var(--am-line);
    border-radius: 5px;
    background: var(--am-white);
}
#authModal .custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--am-rosegold);
    background: var(--am-rosegold);
}
#authModal .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(183, 110, 121, 0.18);
}

/* Links */
#authModal .auth-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--am-rosegold-deep);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}
#authModal .auth-link:hover { color: var(--am-rosegold); text-decoration: underline; }

#authModal .auth-resend-text {
    color: var(--am-muted);
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════
   SUBMIT BUTTONS  (override base .hiraola-btn_dark)
   ═══════════════════════════════════════════════════════ */
#authModal .hiraola-group_btn { margin-top: 6px; }

#authModal .hiraola-btn_dark.auth-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    padding: 0 24px;
    border: 1px solid var(--am-rosegold);
    border-radius: var(--am-radius-pill);
    background: var(--am-rosegold);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 14px 30px rgba(183, 110, 121, 0.28);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Shine sweep is provided globally by button-consistency.css — do not suppress it here. */
#authModal .hiraola-btn_dark.auth-submit-btn:hover {
    background: var(--am-rosegold-deep);
    border-color: var(--am-rosegold-deep);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(183, 110, 121, 0.35);
}
#authModal .hiraola-btn_dark.auth-submit-btn:disabled,
#authModal .hiraola-btn_dark.auth-submit-btn.is-loading {
    opacity: 0.72;
    cursor: wait;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   MESSAGES
   ═══════════════════════════════════════════════════════ */
#authModal .auth-message {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: var(--am-radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: none;
}
#authModal .auth-message p { margin: 0; }
#authModal .auth-message.error {
    display: block;
    border: 1px solid rgba(192, 57, 43, 0.25);
    background: rgba(192, 57, 43, 0.07);
    color: var(--am-danger);
}
#authModal .auth-message.success {
    display: block;
    border: 1px solid rgba(30, 132, 73, 0.25);
    background: rgba(30, 132, 73, 0.07);
    color: var(--am-success);
}
#authModal .auth-message.info {
    display: block;
    border: 1px solid var(--am-rosegold-pale);
    background: var(--am-rose-mist);
    color: var(--am-rosegold-deep);
}

/* ═══════════════════════════════════════════════════════
   OTP + FORGOT SECTIONS
   ═══════════════════════════════════════════════════════ */
#authModal #login-otp-section,
#authModal #register-otp-section {
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px solid var(--am-line-light);
}

#authModal .auth-otp-label {
    display: block;
    margin-bottom: 16px;
    color: var(--am-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#authModal .otp-inputs { gap: 10px; }

#authModal .otp-box {
    width: 48px;
    height: 56px;
    padding: 0;
    border: 1px solid var(--am-line);
    border-radius: var(--am-radius-sm);
    background: var(--am-pearl);
    color: var(--am-charcoal);
    font-size: 24px !important;
    font-weight: 700;
    box-shadow: none;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#authModal .otp-box::placeholder { color: var(--am-line); font-weight: 400; }
#authModal .otp-box:focus {
    border-color: var(--am-rosegold);
    background: var(--am-white);
    box-shadow: 0 0 0 4px rgba(183, 110, 121, 0.14);
    outline: none;
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    #authModal .modal-dialog { max-width: 460px; }

    #authModal .auth-modal__inner { display: block; max-height: 92vh; overflow: hidden; }

    /* Hide the big aside; a compact brand line shows instead */
    #authModal .auth-modal__aside { display: none; }

    #authModal .auth-modal__panel {
        flex: none;
        max-width: 100%;
        max-height: 92vh;
        padding: 44px 30px 34px;
    }

    #authModal .auth-modal__close {
        border-color: var(--am-line);
        background: var(--am-white);
        color: var(--am-ink);
    }
    #authModal .auth-modal__close:hover {
        background: var(--am-rosegold);
        border-color: var(--am-rosegold);
        color: #ffffff;
    }
}

@media (max-width: 575px) {
    #authModal .modal-dialog {
        width: calc(100% - 20px);
        margin: 1rem auto;
    }
    #authModal .auth-modal__panel { padding: 40px 20px 28px; }
    #authModal .auth-panel-title { font-size: 21px; }
    #authModal .otp-box { width: 42px; height: 50px; font-size: 20px !important; }
    #authModal .otp-inputs { gap: 7px; }
    #authModal .auth-modal__brand-name { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    #authModal .modal-content { animation: none; }
    #authModal .auth-modal__close:hover,
    #authModal .hiraola-btn_dark.auth-submit-btn:hover,
    #authModal .otp-box:focus { transform: none; }
}
