/* Account pages (Login / Forgot password / OTP / Reset) — styled to match the
   pos-fe React SPA: shadcn/ui "new-york" + slate base color, system fonts, lucide
   icons. Tokens copied verbatim from pos-fe/src/styles/globals.css so the auth
   screens feel like the same product. */

:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --destructive: 0 84.2% 60.2%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    --radius: 0.5rem;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: hsl(var(--foreground));
    background-color: hsl(var(--muted));
    /* Soft top glow + faint dotted grid for a touch of depth (restrained). */
    background-image:
        radial-gradient(820px circle at 50% -12%, hsl(var(--primary) / 0.06), transparent 60%),
        radial-gradient(hsl(var(--border) / 0.65) 1px, transparent 1px);
    background-size: auto, 22px 22px;
    background-position: center, center;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-wrap { width: 100%; max-width: 400px; }

/* Brand */
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
.auth-brand .mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 1px 2px hsl(var(--primary) / .35), inset 0 1px 0 hsl(0 0% 100% / .08);
}
.auth-brand .name { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }

/* Card */
.card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 0.25rem);
    padding: 28px;
    box-shadow: 0 1px 2px hsl(var(--primary) / .05), 0 12px 32px -14px hsl(var(--primary) / .18);
    animation: rise .55s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: .04s;
}
.card-head { margin-bottom: 20px; }
.card-title { margin: 0; font-size: 1.35rem; font-weight: 640; letter-spacing: -0.02em; }
.card-sub { margin: 6px 0 0; color: hsl(var(--muted-foreground)); font-size: .875rem; }

/* Fields */
.field { margin-bottom: 16px; animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.label { display: block; font-size: .82rem; font-weight: 500; margin-bottom: 7px; }
.control { position: relative; display: flex; align-items: center; }
.control > .icon {
    position: absolute;
    left: 12px;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
    display: grid;
    place-items: center;
}
.input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 38px;
    font: inherit;
    font-size: .9rem;
    color: hsl(var(--foreground));
    background: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 0.125rem);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: hsl(var(--muted-foreground)); opacity: .7; }
.input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .12); }
.input.has-toggle { padding-right: 42px; }

.pw-toggle {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    padding: 7px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    transition: color .15s, background .15s;
}
.pw-toggle:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }

/* Buttons */
.btn {
    width: 100%;
    height: 40px;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    font-weight: 550;
    color: hsl(var(--primary-foreground));
    background: hsl(var(--primary));
    border-radius: calc(var(--radius) - 0.125rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter .15s ease, transform .04s ease, box-shadow .15s ease;
    box-shadow: 0 1px 2px hsl(var(--primary) / .25);
}
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }

.btn-outline {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 0.125rem);
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-outline:hover { background: hsl(var(--muted)); }

/* Misc layout helpers */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: hsl(var(--muted-foreground)); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: hsl(var(--primary)); }
.link { color: hsl(var(--foreground)); font-size: .85rem; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.link-muted { color: hsl(var(--muted-foreground)); }
.center { text-align: center; }
.mt { margin-top: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; }
/* A submit button that should look like an inline text link (e.g. "Gửi lại OTP"). */
.link-button { background: none; border: 0; padding: 0; margin: 0 auto; cursor: pointer; font: inherit; }

/* Validation + alerts */
.field-error,
.field-validation-error { color: hsl(var(--destructive)); font-size: .8rem; margin-top: 6px; display: block; }
.input-validation-error { border-color: hsl(var(--destructive)) !important; }
.input-validation-error:focus { box-shadow: 0 0 0 3px hsl(var(--destructive) / .14) !important; }

.alert { border-radius: calc(var(--radius) - 0.125rem); padding: 11px 13px; font-size: .85rem; margin-bottom: 18px; border: 1px solid transparent; }
.alert-error,
.validation-summary-errors { background: hsl(var(--destructive) / .08); border-color: hsl(var(--destructive) / .25); color: hsl(0 72% 41%); }
/* The asp-validation-summary tag helper adds `.validation-summary-errors` itself, so the
   markup no longer sets `class="alert alert-error"` (that pre-set class made the framework's
   AddClass merge render a mangled `ClassAttributeHtmlContent` value). Give the framework class
   the same box styling `.alert` provides. */
.validation-summary-errors { border-radius: calc(var(--radius) - 0.125rem); padding: 11px 13px; font-size: .85rem; margin-bottom: 18px; border: 1px solid hsl(var(--destructive) / .25); }
.alert-error ul,
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.alert-info { background: hsl(214 95% 95%); border-color: hsl(214 80% 84%); color: hsl(214 70% 32%); }
.alert-success { background: hsl(142 70% 95%); border-color: hsl(142 45% 78%); color: hsl(142 64% 24%); }
.validation-summary-valid { display: none; }

/* Divider for external providers */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: hsl(var(--muted-foreground)); font-size: .75rem; text-transform: none; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: hsl(var(--border)); }
.providers { display: flex; gap: 8px; flex-wrap: wrap; }

/* Entrance animation + stagger */
@keyframes rise {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: none; }
}
.s1 { animation-delay: .10s; }
.s2 { animation-delay: .16s; }
.s3 { animation-delay: .22s; }
.s4 { animation-delay: .28s; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; }
}
