/* Account request form (components/account_requests.py): the entry next to the login forms + the panel.
   Every rule is scoped under #ar_root (all /assets stylesheets load on every page). Desktop: a side panel from the
   right; mobile: a full-screen sheet from the bottom. Tokens as the app (theme.py / mb_style.css): panels
   rgba(0,0,0,.6), text #e8e8e8, muted #9fb3c8, headings #cfefff, accent amber #f0a030. */

#ar_root { --ar-text: #e8e8e8; --ar-muted: #9fb3c8; --ar-head: #cfefff; --ar-acc: #f0a030; --ar-line: rgba(255,255,255,.11);
           --ar-chip: rgba(255,255,255,.06); --ar-good: #3fbf7f; --ar-bad: #ff9b91;
           font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ar-text); }
#ar_root *, #ar_root *::before, #ar_root *::after { box-sizing: border-box; }

/* ---------- the entry (next to the login inputs) ---------------------------------------------------- */
#ar_root .ar-entry { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; font-size: .8rem; }
#ar_root .ar-q { color: var(--ar-muted); }
#ar_root .ar-open { background: none; border: 0; padding: 2px 0; color: var(--ar-acc); font: inherit; font-weight: 650;
                    cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
#ar_root .ar-open:hover, #ar_root .ar-open:focus-visible { color: #ffc46b; outline: none; }
#ar_root .ar-loginmsg:not(:empty) { margin-top: 8px; padding: 8px 10px; border-radius: 10px; font-size: .8rem; line-height: 1.4;
                                    color: #f5d6a3; background: rgba(240,160,48,.10); border: 1px solid rgba(240,160,48,.45); }
#ar_root.ar-mobile .ar-entry { justify-content: center; margin: 12px 0 0; font-size: .92rem; }
#ar_root.ar-mobile .ar-open { min-height: 44px; }
#ar_root.ar-mobile .ar-loginmsg:not(:empty) { margin: 10px 4vw 0; }

/* ---------- the panel -------------------------------------------------------------------------------- */
#ar_root .ar-panel { position: fixed; inset: 0; z-index: 1300; pointer-events: none; visibility: hidden;
                     transition: visibility 0s linear .3s; }
#ar_root.open .ar-panel { pointer-events: auto; visibility: visible; transition: visibility 0s; }
#ar_root .ar-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .25s ease; }
#ar_root.open .ar-backdrop { opacity: 1; }
#ar_root .ar-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); display: flex; flex-direction: column;
                     background: linear-gradient(170deg, rgba(6,18,24,.98), rgba(4,10,14,.98) 60%, rgba(10,40,46,.98));
                     border-left: 1px solid var(--ar-line); box-shadow: -18px 0 40px rgba(0,0,0,.55);
                     transform: translateX(104%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
#ar_root.open .ar-sheet { transform: none; }
#ar_root.ar-mobile .ar-sheet { top: 0; left: 0; width: 100vw; border-left: 0; transform: translateY(104%);
                               padding-bottom: env(safe-area-inset-bottom); }
#ar_root.ar-mobile.open .ar-sheet { transform: none; }
#ar_root .ar-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 10px 20px;
                    border-bottom: 1px solid var(--ar-line); }
#ar_root .ar-title { flex: 1 1 auto; min-width: 0; color: var(--ar-head); font-size: 1.12rem; font-weight: 650; }
#ar_root .ar-x { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--ar-head);
                 font-size: 1.15rem; cursor: pointer; }
#ar_root .ar-x:hover, #ar_root .ar-x:focus-visible { background: var(--ar-chip); outline: none; }
#ar_root .ar-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
                      -webkit-overflow-scrolling: touch; padding: 6px 20px 28px; }
#ar_root.ar-mobile .ar-scroll { padding: 6px 16px 32px; }
#ar_root .ar-spin { width: 30px; height: 30px; margin: 40px auto; border-radius: 50%; border: 3px solid rgba(255,255,255,.12);
                    border-top-color: var(--ar-acc); animation: ar-spin .8s linear infinite; }
@keyframes ar-spin { to { transform: rotate(360deg); } }

/* ---------- the form ---------------------------------------------------------------------------------- */
#ar_root .ar-intro { color: #dfe7ee; font-size: .86rem; line-height: 1.5; margin: 6px 0 4px; }
#ar_root .ar-sec { margin: 18px 0 2px; color: var(--ar-muted); font-size: .7rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
#ar_root .ar-field { margin-top: 10px; min-width: 0; }
#ar_root .ar-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
@media (max-width: 420px) { #ar_root .ar-two { grid-template-columns: minmax(0, 1fr); } }
#ar_root .ar-lab { display: block; margin: 0 0 5px; color: var(--ar-head); font-size: .8rem; font-weight: 600; }
#ar_root .ar-req { color: var(--ar-acc); }
#ar_root .ar-opt { color: #7f93a8; font-weight: 400; font-size: .74rem; }
#ar_root .ar-help { margin-top: 4px; color: #7f93a8; font-size: .72rem; line-height: 1.4; }
#ar_root .ar-help-wide { margin-top: 6px; }
#ar_root .ar-in { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--ar-line);
                  background: rgba(255,255,255,.05); color: var(--ar-text); font-size: 15px; color-scheme: dark; }
#ar_root.ar-mobile .ar-in { height: 46px; font-size: 16px; /* no zoom on focus (iOS) */ }
#ar_root .ar-in:focus { outline: none; border-color: rgba(240,160,48,.75); background: rgba(255,255,255,.07); }
#ar_root .ar-ta { height: auto; min-height: 76px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
#ar_root .ar-hint { min-height: 0; font-size: .74rem; margin-top: 4px; }
#ar_root .ar-good { color: var(--ar-good); }
#ar_root .ar-bad { color: var(--ar-bad); }

/* the Language dropdown at the top of the form (dcc.Dropdown = react-select v1 classes) */
#ar_root .ar-langbar { display: grid; grid-template-columns: auto minmax(0, 190px); align-items: center; gap: 4px 12px;
                       margin: 4px 0 6px; padding: 10px 12px; border-radius: 10px;
                       background: rgba(75,233,250,.05); border: 1px solid rgba(75,233,250,.22); }
#ar_root .ar-langbar .ar-help { grid-column: 1 / -1; margin-top: 0; }
#ar_root .ar-lang-lab { color: var(--ar-head); font-size: .82rem; font-weight: 650; }
#ar_root .ar-lang-lab i { color: #4be9fa; margin-right: 2px; }
#ar_root .ar-dd .Select-control { height: 38px; border-radius: 10px; border: 1px solid var(--ar-line); background: rgba(255,255,255,.06);
                                  cursor: pointer; box-shadow: none; }
#ar_root .ar-dd.is-focused .Select-control, #ar_root .ar-dd .Select-control:hover { border-color: rgba(240,160,48,.75); }
#ar_root .ar-dd .Select-value, #ar_root .ar-dd .Select-placeholder { line-height: 36px; padding-left: 12px; }
#ar_root .ar-dd .Select-value-label { color: var(--ar-text) !important; font-size: .9rem; }
#ar_root .ar-dd .Select-input { height: 36px; }
#ar_root .ar-dd .Select-arrow { border-top-color: var(--ar-muted); }
#ar_root .ar-dd .Select-menu-outer { margin-top: 4px; border-radius: 10px; overflow: hidden; border: 1px solid var(--ar-line);
                                     background: #0b1a20; box-shadow: 0 10px 26px rgba(0,0,0,.55); z-index: 5; }
#ar_root .ar-dd .Select-menu { max-height: 220px; }
#ar_root .ar-dd .Select-option { background: transparent; color: var(--ar-text); padding: 9px 12px; font-size: .9rem; }
#ar_root .ar-dd .Select-option.is-focused { background: rgba(240,160,48,.14); }
#ar_root .ar-dd .Select-option.is-selected { background: rgba(240,160,48,.22); color: #fff; }
/* dcc.Dropdown renders its options through react-virtualized-select: dark menu (the default CSS paints it white) */
#ar_root .ar-dd .Select-menu-outer, #ar_root .ar-dd .Select-menu { background: #0b1a20 !important; }
#ar_root .ar-dd .VirtualizedSelectOption { color: #e8e8e8 !important; background: transparent !important; padding: 0 12px; font-size: .9rem; cursor: pointer; }
#ar_root .ar-dd .VirtualizedSelectFocusedOption { background: rgba(240,160,48,.16) !important; color: #fff !important; }
#ar_root .ar-dd .VirtualizedSelectSelectedOption { color: #ffd38a !important; font-weight: 650; }
#ar_root.ar-mobile .ar-langbar { grid-template-columns: minmax(0, 1fr); }
#ar_root.ar-mobile .ar-dd .Select-control { height: 44px; }

/* chips (dcc.RadioItems) */
#ar_root .ar-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#ar_root .ar-chip { position: relative; display: inline-flex; align-items: center; min-height: 36px; margin: 0; padding: 6px 12px;
                    border-radius: 18px; cursor: pointer; font-size: .8rem; line-height: 1.25; color: var(--ar-text);
                    background: var(--ar-chip); border: 1px solid var(--ar-line); transition: background .15s ease, border-color .15s ease; }
#ar_root.ar-mobile .ar-chip { min-height: 42px; font-size: .86rem; }
#ar_root .ar-chip:hover { border-color: rgba(240,160,48,.5); }
#ar_root .ar-chip-in { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
#ar_root .ar-chip:has(.ar-chip-in:checked) { background: rgba(240,160,48,.16); border-color: rgba(240,160,48,.8); color: #fff; }
#ar_root .ar-chip:has(.ar-chip-in:focus-visible) { outline: 2px solid #4be9fa; outline-offset: 2px; }

/* privacy + consent */
#ar_root .ar-privacy { margin: 18px 0 8px; padding: 10px 12px; border-radius: 10px; font-size: .76rem; line-height: 1.45; color: #cfdcea;
                       background: rgba(75,233,250,.06); border: 1px solid rgba(75,233,250,.25); }
#ar_root .ar-privacy i { color: #4be9fa; }
#ar_root .ar-consent label { display: flex !important; /* Dash sets display: block inline */ align-items: flex-start; gap: 10px; margin: 0; font-size: .8rem; line-height: 1.45;
                             color: var(--ar-text); cursor: pointer; }
#ar_root .ar-check { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ar-acc); }

/* honeypot: off-screen, not announced */
#ar_root .ar-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* buttons, messages */
#ar_root .ar-btn { width: 100%; min-height: 46px; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
                   border-radius: 12px; font: inherit; font-weight: 650; font-size: .92rem; color: #1b1205; cursor: pointer;
                   background: linear-gradient(180deg, #f6b450, #f0a030); border: 1px solid #f0a030; box-shadow: 0 6px 18px rgba(240,160,48,.25); }
#ar_root .ar-btn:hover { filter: brightness(1.06); }
#ar_root .ar-btn:active { transform: translateY(1px); }
#ar_root .ar-btn-2 { color: #f5d6a3; background: rgba(240,160,48,.12); box-shadow: none; }
#ar_root .ar-msg:not(:empty) { margin-top: 12px; }
#ar_root .ar-err { padding: 10px 12px; border-radius: 10px; color: #ffd0cb; font-size: .8rem; line-height: 1.45;
                   background: rgba(230,103,103,.10); border: 1px solid rgba(230,103,103,.5); }
#ar_root .ar-err-t { font-weight: 650; margin-bottom: 2px; }
#ar_root .ar-err ul { margin: 0; padding-left: 18px; }

/* sent */
#ar_root .ar-done { text-align: center; padding: 48px 8px 12px; }
#ar_root .ar-done-ic { font-size: 2.6rem; color: var(--ar-good); }
#ar_root .ar-done-t { margin-top: 12px; color: var(--ar-head); font-size: 1.08rem; font-weight: 650; line-height: 1.4; }
#ar_root .ar-done-s { margin-top: 8px; color: var(--ar-muted); font-size: .86rem; line-height: 1.5; }
/* "Explore as a guest" (components/guest.py) */
#ar_root .ar-done-guest { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
#ar_root .ar-done-guest .ar-btn { margin-top: 14px; }

/* the desktop login message (in suggestion_div, outside #ar_root) */
.ar-loginmsg-d { color: #f5d6a3; font-size: .82rem; }

@media (prefers-reduced-motion: reduce) {
    #ar_root *, #ar_root *::before, #ar_root *::after { animation: none !important; transition: none !important; }
}
#ar_root .ar-x2 { display: none; }
#ar_root .ar-scroll:has(.ar-done) .ar-x2 { display: flex; }

/* ---- one-time codes on the login page (components/login_codes.py): "enter your code", "forgot your password",
        "choose a new password" in this same panel ---- */
#ar_root .ar-forgot { font-weight: 500; color: var(--ar-muted); flex-basis: 100%; text-align: left; }
#ar_root .ar-forgot:hover, #ar_root .ar-forgot:focus-visible { color: var(--ar-head); }
#ar_root.ar-mobile .ar-forgot { text-align: center; min-height: 36px; }
#ar_root .lc-ic { margin: 22px 0 6px; text-align: center; font-size: 2.2rem; color: var(--ar-acc); }
#ar_root .lc-view .ar-intro { text-align: center; margin-bottom: 10px; }
#ar_root .lc-code { height: 54px; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
                    font-size: 1.35rem; letter-spacing: .16em; text-transform: uppercase; }
#ar_root.ar-mobile .lc-code { height: 58px; font-size: 1.4rem; }
#ar_root .lc-code::placeholder { letter-spacing: .12em; color: rgba(159,179,200,.45); }
#ar_root .lc-guest { text-align: center; }
#ar_root .ar-help-mail { color: #b9c8d8; }
#ar_root .ar-help-mail i { color: var(--ar-acc); }
#ar_root .ar-msg > .ar-err { margin-top: 2px; }
