/* ==========================================================================
   ThaiGovAgency — AUTH SURFACE
   --------------------------------------------------------------------------
   A standalone, full-bleed sign-in / sign-up surface. It loads theme.css (for
   tokens, buttons, forms, alerts) then this file for the shell, the glass card
   and the two-step registration. It deliberately does NOT load public.css or
   use the site header/footer: auth pages are their own thing.
   ========================================================================== */

/* ------------------------------- shell ----------------------------------- */
.auth-body { background: #0b0f1e; }

.auth-shell {
    position: relative; min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column; overflow: hidden;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}

/* The brand background: layered glows over a deep navy, plus a faint dot grid.
   To use a photo instead, drop it at assets/img/auth/bg.jpg and add
   `.auth-bg::before { content:''; position:absolute; inset:0; opacity:.32;
   background:url(../img/auth/bg.jpg) center/cover; }` below. Nothing requests
   the file until you do, so there is no 404 while it is absent. */
.auth-bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(900px 520px at 12% 8%,  rgba(211, 47, 47, .38), transparent 62%),
        radial-gradient(820px 620px at 88% 18%, rgba(106, 27, 154, .48), transparent 62%),
        radial-gradient(760px 560px at 50% 108%, rgba(165, 27, 111, .34), transparent 62%),
        linear-gradient(160deg, #0b0f1e 0%, #131a2e 52%, #1c1233 100%);
}
.auth-bg::after {
    content: ''; position: absolute; inset: 0; opacity: .5;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.6px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
            mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}

/* A soft vignette so the card and header text always have contrast. */
.auth-scrim {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(6, 9, 20, .55) 100%);
}

/* ------------------------------- top bar --------------------------------- */
.auth-topbar {
    position: relative; z-index: 2; width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px clamp(16px, 4vw, 40px);
}
.auth-brand { display: inline-flex; align-items: center; font-size: 17px; font-weight: 800; color: #fff; }
.auth-brand:hover { text-decoration: none; }
.auth-brand img { height: 38px; width: auto; display: block; border-radius: 8px; }
.auth-brand .mark {
    display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 10px;
    border-radius: 10px; background: var(--t-cta-grad); color: #fff; font-weight: 800;
}

.auth-back {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 9px 15px; border-radius: 999px; font-size: 13px; font-weight: 700;
    color: #fff; background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .26);
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.auth-back:hover { background: var(--t-red); border-color: var(--t-red); color: #fff; text-decoration: none; transform: translateY(-1px); }

/* -------------------------------- card ----------------------------------- */
.auth-main {
    position: relative; z-index: 2; flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: clamp(16px, 4vw, 40px);
}

.auth-card {
    width: 100%; max-width: 428px; padding: clamp(20px, 4.5vw, 32px);
    border-radius: var(--t-radius-lg);
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 30px 70px rgba(4, 7, 18, .55);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    animation: auth-rise .32s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

.auth-head { text-align: center; margin-bottom: 18px; }
.auth-title { margin: 0 0 5px; font-size: 23px; letter-spacing: -.6px; }
.auth-sub { margin: 0; color: var(--t-muted); font-size: 13px; }

/* alerts mirror the theme's, tuned for the card */
.auth-alert {
    padding: 10px 13px; border-radius: 10px; font-size: 12.5px; margin-bottom: 14px;
    border: 1px solid transparent;
}
.auth-alert-success { background: var(--t-green-tint); border-color: #a9d9b8; color: #14532d; }
.auth-alert-error   { background: var(--t-red-tint);   border-color: #f3bcbc; color: var(--t-red-2); }
.auth-alert-info    { background: var(--t-blue-card);  border-color: var(--t-blue-line); color: #14507f; }

/* fields read a touch larger than the dashboard's, since this is a first touch */
.auth-card .form-group { margin-bottom: 13px; }
.auth-card .form-group label { font-size: 12px; }
.auth-card .form-control { padding: 11px 13px; border-radius: 10px; font-size: 14px; }
.auth-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.auth-inline-link { font-size: 12.5px; font-weight: 700; }

/* --------------------------------- CTA ----------------------------------- */
.auth-cta {
    width: 100%; padding: 12px 18px; margin-top: 4px;
    font-size: 14px; border-radius: 11px;
}
.auth-cta .arw { font-size: 17px; line-height: 1; }

/* --------------------------- footer links -------------------------------- */
.auth-links { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--t-muted); line-height: 1.85; }
.auth-links a { color: var(--t-red); font-weight: 700; }
.auth-links .sep { opacity: .45; margin: 0 8px; }

.auth-foot { position: relative; z-index: 2; margin: 0; font-size: 12px; color: rgba(255, 255, 255, .72); text-align: center; }

/* --------------------------- two-step register --------------------------- */
.auth-steps {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    list-style: none; margin: 0 0 22px; padding: 0;
}
.auth-steps li {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 700; color: var(--t-muted);
}
.auth-steps li::before {
    content: attr(data-step); display: inline-grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: #eef1f6; color: var(--t-muted); font-size: 11.5px; font-weight: 800;
}
.auth-steps li.is-active { color: var(--t-text); }
.auth-steps li.is-active::before { background: var(--t-cta-grad); color: #fff; }
.auth-steps .bar { width: 26px; height: 2px; border-radius: 2px; background: var(--t-line); }

.auth-step[hidden] { display: none; }

/* the invited-by chip used on step 1 */
.auth-invite {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 13px; margin-bottom: 14px; border-radius: 12px;
    background: var(--t-green-tint); border: 1px solid #a9d9b8;
}
.auth-invite .ic {
    width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px;
    display: grid; place-items: center; background: var(--t-green); color: #fff; font-weight: 800;
}
.auth-invite b { display: block; font-size: 14px; color: #14532d; }
.auth-invite span { font-size: 12.5px; color: #2f6b45; }

.auth-code { font-variant-numeric: tabular-nums; letter-spacing: 2px; font-weight: 700; background: #f4f6f9; }

.auth-step-actions { display: flex; gap: 10px; margin-top: 6px; }
.auth-step-actions .auth-cta { margin-top: 0; }

/* --------------------------------- misc ---------------------------------- */
.auth-note { font-size: 12px; color: var(--t-muted); margin-top: 10px; }
.auth-card .req { color: var(--t-red); font-weight: 700; }

/* A neutral action next to the CTA (the register "Back"). */
.auth-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 18px; border-radius: 11px; font-size: 14px; font-weight: 700;
    background: #fff; color: var(--t-text); border: 1px solid var(--t-line);
    font-family: inherit; cursor: pointer; transition: background .16s ease;
}
.auth-ghost:hover { background: #f2f4f8; }
.auth-ghost:focus-visible { outline: 2px solid var(--t-red); outline-offset: 2px; }
.auth-step-actions .auth-ghost { flex: 0 0 auto; }
.auth-step-actions .auth-cta { flex: 1; }

/* Visually hidden, still announced. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 520px) {
    .auth-topbar { padding: 14px 16px; }
    .auth-back span.txt { display: none; }
    .auth-card { border-radius: 16px; }
    .auth-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
    .auth-back, .auth-cta { transition: none; }
    .auth-back:hover { transform: none; }
}
