/*
 * Register page, login card and login pop-up, and the phone box with a country-code menu.
 * Ported from ilmcode-printing's own auth-pages.css (identical structure/behavior, brand
 * colour swapped to this admin's own indigo/violet, matching the acp dashboard/login).
 * Everything is scoped (.rg register, .lc login card, .lm pop-up, .gp phone box).
 */

:root { --au-brand: #6366f1; --au-brand-dark: #4f46e5; --au-ink: #0f172a; --au-text: #344054; --au-mute: #64748b; --au-line: #e2e8f0; --au-soft: #f8fafc; }

/* ============================================================ phone box with country code */
.gp { position: relative; display: flex; align-items: stretch; border: 1px solid var(--au-line); border-radius: 8px; background: #fff; }
.gp:focus-within { border-color: var(--au-brand); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.gp-btn { display: flex; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-right: 1px solid var(--au-line); border-radius: 8px 0 0 8px; background: #f1f5f9; color: var(--au-text); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.gp-btn:hover { background: #e8eef4; }
.gp-flag { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .14); flex: 0 0 auto; }
.gp-dial { font-weight: 600; }
.gp-btn i { font-size: 10px; opacity: .6; }
.gp .gp-input { flex: 1; min-width: 0; border: 0 !important; border-radius: 0 8px 8px 0 !important; box-shadow: none !important; background: transparent; }
.gp-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: min(360px, 92vw); background: #fff; border: 1px solid var(--au-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); overflow: hidden; }
.gp-pop[hidden] { display: none; }
.gp .gp-search { width: 100%; border: 0 !important; border-bottom: 1px solid var(--au-line) !important; border-radius: 0 !important; padding: 11px 14px !important; box-shadow: none !important; font-size: 14px; }
.gp-list { list-style: none; margin: 0; padding: 4px 0; max-height: 264px; overflow-y: auto; }
.gp-list li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.gp-list li:hover, .gp-list li.is-on { background: #eef6f6; }
.gp-list li img { flex: 0 0 22px; width: 22px; height: 15px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .14); }
.gp-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--au-ink); }
.gp-list li em { font-style: normal; color: var(--au-mute); font-size: 13px; }
.gp-list .gp-group { cursor: default; padding: 8px 14px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--au-mute); background: transparent !important; }
.gp-list .gp-none { cursor: default; color: var(--au-mute); }

/* ============================================================ register page */
.rg { min-height: 100vh; background: var(--au-soft); padding: 34px 0 60px; color: var(--au-ink); }
.rg *, .rg *::before, .rg *::after { box-sizing: border-box; }
.rg-wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.rg h1 { margin: 0; text-align: center; font-size: 30px; font-weight: 700; }
.rg-sub { margin: 8px 0 24px; text-align: center; font-size: 16px; color: var(--au-mute); }
.rg-card { padding: 26px 32px 32px; border: 1px solid var(--au-line); border-radius: 16px; background: #fff; }

.rg-tabs { display: flex; width: max-content; margin: 0 auto 24px; padding: 4px; border-radius: 10px; background: #eef2f6; }
.rg-tabs button { padding: 9px 18px; border: 0; border-radius: 7px; background: transparent; font: inherit; font-size: 15px; font-weight: 500; color: var(--au-ink); cursor: pointer; }
.rg-tabs button.is-on { background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.rg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.rg-full { grid-column: 1 / -1; }
.rg-field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 500; }
.rg-field input:not([type=checkbox]):not([type=hidden]):not(.gp-search), .rg-field select {
    width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--au-line); border-radius: 8px; background: #fff;
    font: inherit; font-size: 15px; color: var(--au-ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.rg-field input:focus, .rg-field select:focus { border-color: var(--au-brand); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.rg-field select[hidden], .rg-field input[hidden] { display: none; }
.rg-field em { display: block; margin-top: 6px; font-style: normal; font-size: 12.5px; color: #dc2626; }
.rg-company { display: none; }
.rg-company.is-on { display: contents; }

.pw { position: relative; }
.pw input { padding-right: 44px !important; }
.pw button { position: absolute; top: 0; right: 0; height: 46px; width: 44px; border: 0; background: transparent; color: var(--au-mute); cursor: pointer; }

.rg-terms { margin: 22px 0 0; font-size: 14px; color: var(--au-text); }
.rg-terms a { color: var(--au-text); text-decoration: underline; }
.rg-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.au-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px; border: 1px solid transparent; border-radius: 8px; background: var(--au-brand); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s; }
.au-btn:hover { background: var(--au-brand-dark); color: #fff; }
.au-btn--block { width: 100%; }
.au-btn--ghost { background: #fff; color: var(--au-ink); border-color: var(--au-line); }
.au-btn--ghost:hover { background: #f1f5f9; color: var(--au-ink); }
.rg-note { margin-top: 18px; padding: 10px 14px; border-radius: 8px; background: #fef2f2; color: #b91c1c; font-size: 13.5px; }

/* ============================================================ login: the card and the pop-up */
.lc { padding: 24px 24px 22px; text-align: center; }
.lc-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 50%; background: var(--au-brand); overflow: hidden; }
.lc-mark img { width: 30px; height: 30px; object-fit: contain; }
.lc h2 { margin: 6px 0 4px; font-size: 24px; font-weight: 700; color: var(--au-ink); }
.lc-sub { margin: 0 0 22px; font-size: 14px; color: var(--au-text); }
.lc form { text-align: left; }
.lc .rg-field { margin-bottom: 16px; }
.lc-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; font-size: 14px; }
.lc-row label { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.lc-row a { color: #5b3fd0; text-decoration: none; }
.lc-row a:hover { text-decoration: underline; }
.lc .au-btn--block + .au-btn--block { margin-top: 12px; }

.lm { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .55); }
.lm.is-open { display: flex; }
.lm-box { position: relative; width: min(400px, 100%); max-height: 96vh; overflow: auto; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); animation: lmIn .18s ease-out; }
.lm-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--au-mute); font-size: 20px; cursor: pointer; }
.lm-x:hover { background: #f1f5f9; }
@keyframes lmIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
body.lm-lock { overflow: hidden; }

.la { min-height: 100vh; padding: 40px 16px; background: var(--au-soft); display: flex; align-items: center; }
.la-box { width: 100%; max-width: 440px; margin: 0 auto; border: 1px solid var(--au-line); border-radius: 16px; background: #fff; }

@media (max-width: 640px) {
    .rg-card { padding: 20px 16px 24px; }
    .rg-grid { grid-template-columns: 1fr; }
    .rg-actions .au-btn { width: 100%; }
}

.gp.is-locked { background: #f1f5f9; }
.gp.is-locked .gp-btn { pointer-events: none; opacity: .7; }

.auth-theme-toggle {
    position: fixed; top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 12px; z-index: 10;
    border: 1px solid var(--au-line); background: #fff; color: #64748b; display: grid; place-items: center; cursor: pointer;
}
.dark .auth-theme-toggle { background: #1e293b; border-color: rgba(148,163,184,.2); color: #cbd5e1; }

/* ============================================================ dark mode (Tailwind's .dark on <html>, same toggle as the client portal shell) */
.dark .rg, .dark .la { background: #020617; }
.dark .rg-card, .dark .la-box { background: #0f172a; border-color: rgba(148,163,184,.16); }
.dark .rg h1, .dark .rg-field label, .dark .lc h2 { color: #f1f5f9; }
.dark .rg-sub, .dark .lc-sub, .dark .rg-terms, .dark .rg-terms a { color: #94a3b8; }
.dark .rg-tabs { background: rgba(148,163,184,.1); }
.dark .rg-tabs button { color: #cbd5e1; }
.dark .rg-tabs button.is-on { background: #1e293b; color: #fff; }
.dark .rg-field input:not([type=checkbox]):not([type=hidden]):not(.gp-search),
.dark .rg-field select,
.dark .gp { background: #0b1222; border-color: rgba(148,163,184,.2); color: #e2e8f0; }
.dark .gp-btn { background: #1e293b; border-color: rgba(148,163,184,.2); color: #cbd5e1; }
.dark .gp-btn:hover { background: #263449; }
.dark .gp-pop { background: #0f172a; border-color: rgba(148,163,184,.2); }
.dark .gp-list li:hover, .dark .gp-list li.is-on { background: #1e293b; }
.dark .gp-list li span { color: #e2e8f0; }
.dark .lc-row a { color: #a5b4fc; }
.dark .au-btn--ghost { background: transparent; color: #e2e8f0; border-color: rgba(148,163,184,.2); }
.dark .au-btn--ghost:hover { background: #1e293b; }
