/*
 * auth.css — /Account/* Identity page styles (static SSR, Bronze · cool-gray)
 *
 * ALL rules are scoped under `.auth-shell` (set by AccountLayout.razor) so they
 * cannot bleed into the main MudBlazor app.  Dark mode is driven by
 * @media (prefers-color-scheme: dark) because body.mud-theme-dark is not
 * available on static-SSR pages (no circuit, no MudThemeProvider).
 */

/* ─── Auth token layer (light) ─────────────────────────────────────────────── */
.auth-shell {
  --auth-bg:       #fafafa;
  --auth-surface:  #ffffff;
  --auth-border:   #e4e4e7;
  --auth-fg:       #0b0b0e;
  --auth-mfg:      #71717a;
  --auth-primary:  #8E763E;
  --auth-ring:     #8E763E;
  --auth-primary-contrast: #ffffff;
  --auth-danger:   #dc2626;
}

/* ─── Auth token layer (dark via system preference) ────────────────────────── */
@media (prefers-color-scheme: dark) {
  .auth-shell {
    --auth-bg:       #09090b;
    --auth-surface:  #0f0f12;
    --auth-border:   #27272a;
    --auth-fg:       #fafafa;
    --auth-mfg:      #a1a1aa;
    --auth-primary:  #b0924b;
    --auth-ring:     #b0924b;
    --auth-primary-contrast: #18120a;
    --auth-danger:   #f87171;
  }
}

/* ─── Page shell: full-screen centered layout ───────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-bg);
  color: var(--auth-fg);
  font-family: 'Roboto', system-ui, sans-serif;
  padding: 2rem 1rem;
}

/* ─── Card ──────────────────────────────────────────────────────────────────── */
/* AccountLayout wraps every Identity page body in a single .auth-card. The card
   is the ONLY bordered surface — .row/.col/section inside are layout-only, so we
   never get a card-inside-a-card and the page heading sits inside the card. */
.auth-card {
  width: 100%;
  max-width: 24rem;   /* 384px — shadcn auth card width */
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}

/* Collapse Bootstrap's grid into a single stacked column inside the card. */
.auth-shell .row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  margin: 0;
}

.auth-shell .col-lg-6,
.auth-shell .col-md-4,
.auth-shell .col-xl-6,
.auth-shell .col-lg-4,
.auth-shell .col-md-6 {
  flex: none;
  width: 100%;
  max-width: 100%;
  padding: 0;
}

/* Sections inside the card are layout-only (no nested card chrome). */
.auth-shell section {
  width: 100%;
}

/* ─── Headings ──────────────────────────────────────────────────────────────── */
.auth-shell h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--auth-fg);
  margin-bottom: 0.25rem;
}

.auth-shell h2 {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--auth-mfg);
  margin-bottom: 0;
}

.auth-shell h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--auth-fg);
}

.auth-shell hr {
  border-color: var(--auth-border);
  margin: 0.75rem 0;
  opacity: 1;
}

/* ─── Form floating labels ──────────────────────────────────────────────────── */
/* Convert Bootstrap floating labels into shadcn-style top labels. The <label>
   comes AFTER the <input> in the Identity markup, so column-reverse stacks the
   label on top. We also cancel Bootstrap's absolute label positioning. */
.auth-shell .form-floating {
  position: static;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.375rem;
}

.auth-shell .form-floating > label {
  position: static;
  height: auto;
  padding: 0;
  transform: none;
  opacity: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--auth-fg);
  pointer-events: auto;
}

/* ─── Inputs (.form-control) ────────────────────────────────────────────────── */
.auth-shell .form-control {
  height: 2.25rem;
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid var(--auth-border);
  background: transparent;
  color: var(--auth-fg);
  padding: 0 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-shell .form-control:focus {
  outline: none;
  border-color: var(--auth-ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--auth-ring) 35%, transparent);
}

.auth-shell .form-control::placeholder {
  color: var(--auth-mfg);
  text-align: start;
  opacity: 1;
}

.auth-shell .form-control[disabled],
.auth-shell .form-control:disabled {
  background: color-mix(in srgb, var(--auth-border) 40%, transparent);
  color: var(--auth-mfg);
  cursor: not-allowed;
}

/* Inputs keep the normal shadcn height now that the label sits above them. */
.auth-shell .form-floating > .form-control {
  height: 2.25rem;
  padding: 0 0.75rem;
}

/* ─── Primary button (.btn-primary, .btn-lg) ────────────────────────────────── */
.auth-shell .btn-primary,
.auth-shell .btn.btn-primary {
  width: 100%;
  height: 2.25rem;
  background: var(--auth-primary);
  color: var(--auth-primary-contrast);
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-shell .btn-primary:hover,
.auth-shell .btn.btn-primary:hover {
  background: color-mix(in srgb, var(--auth-primary) 85%, #000);
}

.auth-shell .btn-primary:focus-visible,
.auth-shell .btn.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--auth-ring) 35%, transparent);
}

/* .btn-lg: same treatment, slightly taller */
.auth-shell .btn-lg.btn-primary,
.auth-shell .btn.btn-lg.btn-primary {
  height: 2.5rem;
  font-size: 0.9375rem;
}

/* ─── Checkboxes ─────────────────────────────────────────────────────────────── */
.auth-shell .checkbox label,
.auth-shell .form-check-label {
  font-size: 0.875rem;
  color: var(--auth-fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.auth-shell .form-check-input,
.auth-shell .darker-border-checkbox.form-check-input {
  accent-color: var(--auth-primary);
  border-color: var(--auth-border);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ─── Links ──────────────────────────────────────────────────────────────────── */
.auth-shell a {
  color: var(--auth-primary);
  text-decoration: none;
  font-size: 0.875rem;
}

.auth-shell a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-shell a:focus-visible {
  outline: 2px solid var(--auth-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.auth-shell .form-check-input:focus-visible {
  outline: 2px solid var(--auth-ring);
  outline-offset: 2px;
}

/* ─── Validation / error text ────────────────────────────────────────────────── */
.auth-shell .text-danger {
  color: var(--auth-danger) !important;
  font-size: 0.8125rem;
}

.auth-shell .validation-message {
  color: var(--auth-danger);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

/* ─── Status message (StatusMessage component) ───────────────────────────────── */
.auth-shell .alert {
  border-radius: 0.375rem;
  font-size: 0.875rem;
  padding: 0.625rem 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid var(--auth-border);
  background: color-mix(in srgb, var(--auth-border) 30%, transparent);
  color: var(--auth-fg);
}

/* ─── Spacing helpers (mb-3, etc.) ──────────────────────────────────────────── */
.auth-shell .mb-3 {
  margin-bottom: 0.75rem !important;
}

/* ─── Login/Register external-login divider ─────────────────────────────────── */
/*  Login & Register use .row with .col-lg-6 (local form) + .col-lg-4 (external).
    The .row already stacks them (see Card section); add a divider above the
    external-login column so the two halves read as distinct inside one card. */
.auth-shell .col-lg-4 {
  border-top: 1px solid var(--auth-border);
  padding-top: 1.25rem;
}
