/* ═══════════════════════════════════════════
   Auth Drawer — Aquarapid
   ═══════════════════════════════════════════ */

/* ── Overlay ── */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background .4s ease;
}
.auth-overlay.on {
    background: rgba(0, 0, 0, .45);
    pointer-events: all;
}

/* ── Drawer container ── */
.auth-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    width: 420px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -4px 0 40px rgba(0, 0, 0, .12);
    transform: translateX(100%);
    transition: transform .42s cubic-bezier(.25, .1, .25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.auth-drawer.open {
    transform: translateX(0);
}

/* ── Header ── */
.auth-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #ececec;
    flex-shrink: 0;
}
.auth-drawer__logo {
    height: 18px;
    width: auto;
}
.auth-drawer__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #2c2c2c;
    font-size: 20px;
    line-height: 1;
    font-weight: 300;
    transition: color .15s;
    padding: 0;
    font-family: inherit;
}
.auth-drawer__close:hover { color: #E30613; }

/* ── Body (scrollable) ── */
.auth-drawer__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d4 transparent;
}
.auth-drawer__body::-webkit-scrollbar { width: 4px; }
.auth-drawer__body::-webkit-scrollbar-track { background: transparent; }
.auth-drawer__body::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 2px; }

/* ── Views ── */
.auth-view {
    display: none;
    padding: 36px 28px 40px;
}
.auth-view.active { display: block; }

/* ── View title ── */
.auth-view__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #0a0a0a;
    margin-bottom: 8px;
}
.auth-view__subtitle {
    font-size: 13px;
    color: #9e9e9e;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ── Form sections ── */
.auth-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.auth-field {
    margin-bottom: 20px;
}
.auth-field label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #9e9e9e;
    margin-bottom: 6px;
}
.auth-field label span.req {
    color: #E30613;
}
.auth-field__wrap {
    position: relative;
}
.auth-field input,
.auth-field select {
    width: 100%;
    height: 44px;
    border: none;
    border-bottom: 1.5px solid #d4d4d4;
    background: transparent;
    font-family: var(--f, 'Red Hat Display', sans-serif);
    font-size: 14px;
    color: #0a0a0a;
    padding: 0 0 0 0;
    outline: none;
    transition: border-color .2s;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}
.auth-field input::placeholder { color: #d4d4d4; }
.auth-field input:focus,
.auth-field select:focus {
    border-bottom-color: #0a0a0a;
}
.auth-field input.error,
.auth-field select.error {
    border-bottom-color: #E30613;
}
.auth-field__error {
    display: none;
    margin-top: 4px;
    font-size: 10px;
    color: #E30613;
    font-weight: 500;
}
.auth-field__error.show { display: block; }

/* password toggle */
.auth-field__eye {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9e9e9e;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.auth-field__eye:hover { color: #0a0a0a; }

/* Select arrow */
.auth-field__select-wrap {
    position: relative;
}
.auth-field__select-wrap::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #9e9e9e;
    pointer-events: none;
}

/* Date group */
.auth-date-group {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 8px;
}

/* Gender radio */
.auth-gender-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.auth-gender-item {
    flex: 1;
    min-width: calc(50% - 4px);
}
.auth-gender-item input[type="radio"] {
    display: none;
}
.auth-gender-item label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border: 1.5px solid #d4d4d4;
    font-size: 11px;
    font-weight: 600;
    color: #9e9e9e;
    cursor: pointer;
    transition: all .15s;
    letter-spacing: .5px;
    text-transform: none;
    margin-bottom: 0;
}
.auth-gender-item input[type="radio"]:checked + label {
    border-color: #0a0a0a;
    color: #0a0a0a;
    background: #f7f7f7;
}

/* Checkboxes */
.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
}
.auth-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    min-width: 15px;
    border: 1.5px solid #d4d4d4;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    margin-top: 1px;
    position: relative;
    transition: all .12s;
    border-radius: 0;
}
.auth-checkbox input[type="checkbox"]:checked {
    background: #0a0a0a;
    border-color: #0a0a0a;
}
.auth-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px; left: 3.5px;
    width: 5px; height: 8px;
    border: 1.5px solid #fff;
    border-left: none; border-top: none;
    transform: rotate(45deg);
}
.auth-checkbox__text {
    font-size: 11px;
    color: #616161;
    line-height: 1.5;
}
.auth-checkbox__text a {
    color: #0a0a0a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ececec;
}
.auth-divider span {
    font-size: 10px;
    color: #9e9e9e;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── CTA Buttons ── */
.auth-btn-primary {
    display: block;
    width: 100%;
    height: 50px;
    background: #0a0a0a;
    color: #fff;
    border: none;
    font-family: var(--f, 'Red Hat Display', sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s;
    margin-top: 8px;
}
.auth-btn-primary:hover { background: #E30613; }

.auth-btn-secondary {
    display: block;
    width: 100%;
    height: 48px;
    background: transparent;
    color: #0a0a0a;
    border: 1.5px solid #0a0a0a;
    font-family: var(--f, 'Red Hat Display', sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .2s;
    margin-top: 12px;
}
.auth-btn-secondary:hover { background: #0a0a0a; color: #fff; }

/* ── Switch link ── */
.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #9e9e9e;
}
.auth-switch a {
    color: #0a0a0a;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.auth-switch a:hover { color: #E30613; }

/* ── Forgot password ── */
.auth-forgot {
    display: block;
    text-align: right;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #9e9e9e;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    margin-top: -8px;
    margin-bottom: 24px;
    transition: color .15s;
}
.auth-forgot:hover { color: #E30613; }

/* ── Toast / feedback ── */
.auth-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0a0a0a;
    color: #fff;
    padding: 12px 24px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    white-space: nowrap;
}
.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── User icon state (logged in) ── */
.nav__ic--user.logged .user-dot {
    display: block;
}
.user-dot {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    background: #E30613;
    border-radius: 50%;
    border: 1.5px solid #fff;
}
.nav__ic--user { position: relative; }

/* ── Mobile ── */
@media (max-width: 480px) {
    .auth-drawer { width: 100vw; }
    .auth-view { padding: 28px 20px 36px; }
    .auth-drawer__head { padding: 16px 20px; }
    .auth-form__row { grid-template-columns: 1fr; gap: 0; }
}

/* ── intl-tel-input v23 inside auth drawer (underline-style inputs) ──
   The drawer uses border-bottom only. iti country-container is position:absolute.
   padding-left is set by iti JS inline style — never override with !important. */
.auth-field .iti { display: block; width: 100%; position: relative; }
.auth-field .iti__country-container {
    position: absolute !important;
    top: 0 !important; bottom: 0 !important; left: 0 !important;
    display: flex !important; align-items: stretch !important;
}
.auth-field .iti__selected-country {
    display: flex !important; align-items: center !important;
    background: transparent;
    border: none; border-bottom: 1.5px solid #d4d4d4; border-right: none;
    border-radius: 0; padding: 0 8px 0 0; gap: 5px;
    cursor: pointer; height: 100%; box-sizing: border-box;
}
.auth-field .iti__selected-country:hover { background: rgba(0,0,0,.03); }
.auth-field .iti input[type="tel"] {
    width: 100% !important;
    box-sizing: border-box !important;
    height: 44px !important;
    border: none !important;
    border-bottom: 1.5px solid #d4d4d4 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    /* padding-left set dynamically by iti JS */
    font-size: 14px !important;
    font-family: var(--f, 'Red Hat Display', sans-serif) !important;
    color: #0a0a0a !important;
    outline: none !important;
    transition: border-color .2s !important;
}
.auth-field .iti input[type="tel"]::placeholder { color: #d4d4d4; }
.auth-field .iti input[type="tel"]:focus { border-bottom-color: #0a0a0a !important; }
.auth-field .iti input[type="tel"].error { border-bottom-color: #E30613 !important; }
.auth-field .iti__dropdown-content { border-radius: 0 !important; border: 1px solid #e0e0e0 !important; box-shadow: 0 4px 16px rgba(0,0,0,.1) !important; }
.auth-field .iti__search-input { border-radius: 0 !important; border: none !important; border-bottom: 1px solid #ececec !important; font-size: 13px !important; padding: 6px 10px !important; }
.auth-field .iti__country.iti__highlight { background: #f5f5f5; }

/* ═══ Account nav dropdown (logged-in user icon) ═══ */
.account-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(0, 0, 0, .25);
}
.account-nav-backdrop.is-open { display: block; }

.account-nav-dropdown {
    display: none;
    position: fixed;
    top: 72px;
    right: 16px;
    left: auto;
    width: min(300px, calc(100vw - 32px));
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    z-index: 1060;
    flex-direction: column;
    padding: 8px 0 12px;
    background: #fff;
    color: #0a0a0a;
    border: 1px solid #e8e8e8;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
    font-family: 'Red Hat Display', sans-serif;
}
body.store-template .account-nav-dropdown { top: 88px; }
.account-nav-dropdown.is-open { display: flex; }

.account-nav-dropdown__user {
    padding: 16px 20px;
    margin-bottom: 4px;
    border-bottom: 1px solid #ececec;
}
.account-nav-dropdown__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f3f3f3;
    color: #616161;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}
.account-nav-dropdown__name {
    font-size: 15px;
    font-weight: 700;
    color: #0a0a0a;
    margin-bottom: 2px;
}
.account-nav-dropdown__email {
    font-size: 12px;
    color: #9e9e9e;
    word-break: break-all;
}
.account-nav-dropdown__nav { display: flex; flex-direction: column; }

.account-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #616161;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color .15s, background .15s;
}
button.account-nav__item {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.account-nav__item:hover {
    color: #0a0a0a;
    background: #f7f7f7;
}
.account-nav__item.is-active {
    color: #0a0a0a;
    background: #f7f7f7;
    border-left-color: #E30613;
    padding-left: 18px;
}
.account-nav__item--danger { color: #E30613 !important; }
.account-nav__item--danger:hover { background: #fff5f5 !important; }
.account-nav__icon {
    width: 16px;
    flex-shrink: 0;
    opacity: .55;
}
.account-nav__item.is-active .account-nav__icon { opacity: 1; }
.account-nav__sep {
    height: 1px;
    background: #ececec;
    margin: 6px 20px;
}
.account-nav__badge {
    margin-left: auto;
    background: #E30613;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    line-height: 1.4;
    border-radius: 2px;
}
