/**
 * Account / login slide-down panel.
 *
 * Mirrors the off-canvas vocabulary of duel-panel.css (is-open + overlay), but
 * the sheet drops from the top edge on the right, under the
 * #top_right_container bookmark. Colours come from the theme custom properties
 * (see css_/theme/vars-bridge.css) so the panel follows the Thème switcher.
 *
 */

/* ---- dimming overlay --------------------------------------------------- */
#account-panel-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 9998;
}
#account-panel-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ---- the sliding sheet ------------------------------------------------- */
#account_panel {
    position: fixed;
    top: 0;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: var(--bg-openmenu, #1a4f6d);
    color: var(--menu-main-link-color, #ffffff);
    box-shadow: 0 0 0 rgba(0, 0, 0, .5);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    transform: translateY(-100%);
    transition: transform .45s cubic-bezier(.16, .84, .30, 1),
    box-shadow .45s cubic-bezier(.16, .84, .30, 1);
    z-index: 9999;
}
#account_panel.is-open {
    transform: translateY(0);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

/* Below tablet width the right:24px anchor reads as off-center rather than
   deliberate (there's no wider header/content to its right to anchor against
   visually) — center it instead. Left as-is above 767px, where it lines up
   under the #top_right_container bookmark tab. */
@media only screen and (max-width: 767px) {
    #account_panel {
        right: auto;
        left: 50%;
        transform: translate(-50%, -100%);
    }
    #account_panel.is-open {
        transform: translate(-50%, 0);
    }
}

#account_panel a {
    color: inherit;
}

/* Mobile-only account icon (collapses the desktop 3-icon row into one trigger
   that opens this panel — see .account-icons-inline in 1262-menu-full.css). */
#top_account_trigger {
    display: none;
}

/* ---- logged-in panel content (template/account-panel-account.php) ------ */
.account-panel__links {
    margin: 0;
    padding: 0;
    list-style: none;
}
.account-panel__links li + li {
    margin-top: 4px;
}
.account-panel__links a {
    display: block;
    padding: 13px 15px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    font-size: 15px;
    transition: background .2s ease;
}
.account-panel__links a:hover {
    background: rgba(255, 255, 255, .14);
}
.account-panel__links i {
    width: 20px;
    text-align: center;
}

.account-panel__inner {
    position: relative;
    padding: 34px 34px 30px;
}

.account-panel__close {
    position: absolute;
    top: 14px;
    right: 16px;
    padding: 4px;
    background: none;
    border: 0;
    color: inherit;
    opacity: .6;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.account-panel__title {
    margin: 0 0 4px;
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--coloredtextonthemebg, #ffffff);
}
.account-panel__lead {
    margin: 0 0 18px;
    font-size: 14px;
    opacity: .85;
}

/* ---- form ------------------------------------------------------------- */
.account-form {
    margin: 0;
}
.account-form__field {
    display: block;
    margin: 0 0 14px;
}
.account-form__label {
    display: block;
    margin: 0 0 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .7;
}
.account-form input[type="text"],
.account-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    color: inherit;
    font-size: 15px;
    transition: border-color .2s ease, background .2s ease;
}
.account-form input::placeholder {
    color: rgba(255, 255, 255, .4);
}
.account-form input:focus {
    outline: none;
    border-color: var(--link-color, #e55300);
    background: rgba(255, 255, 255, .12);
}
/* Kill the browser autofill background (the pale yellow/blue box) and keep our
   own dark field + light text. -webkit-box-shadow is the only way to repaint the
   autofill background; -webkit-text-fill-color overrides the autofill text colour. */
.account-form input:-webkit-autofill,
.account-form input:-webkit-autofill:hover,
.account-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-openmenu, #1a4f6d) inset;
    -webkit-text-fill-color: var(--menu-main-link-color, #ffffff);
    caret-color: var(--menu-main-link-color, #ffffff);
    transition: background-color 9999s ease-in-out 0s; /* defeat the autofill fade */
}

.account-form__submit {
    width: 100%;
    margin: 4px 0 10px;
    padding: 12px;
    background: var(--link-color, #e55300);
    color: var(--coloredtextonthemebg, #ffffff);
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
}

.account-form__forgot {
    display: block;
    font-size: 12px;
    text-decoration: underline;
    opacity: .7;
}

/* ---- sign-up footer --------------------------------------------------- */
.account-panel__signup {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .15);
}
.account-panel__signup p {
    margin: 0 0 8px;
    font-size: 14px;
    opacity: .85;
}
.account-form__signup-link {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--link-color, #e55300);
    border-radius: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ---- reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    #account_panel,
    #account-panel-overlay {
        transition: none;
    }
}