/* Entry pages — the start page (index.html) and the sign-in pages (merchant/login.html, backoffice/login.html): white
   cards centred on the bank's colour field, the bank's logo on top, the fewest words that do the job. Colours come
   from the bank tokens in ui.css, so a re-brand follows on its own. */
.auth {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--gradient-brand); color: var(--color-on-brand-field);
}
/* Two soft glows (the accent colour, then white) and the product's lobes at the outer edge. */
.auth::before, .auth::after { content: ""; position: absolute; z-index: -1; border-radius: 999px; pointer-events: none; }
.auth::before { width: 44rem; height: 44rem; inset-block-start: -20rem; inset-inline-start: -14rem; background: radial-gradient(closest-side, color-mix(in srgb, var(--color-accent) 30%, transparent), transparent); }
.auth::after { width: 40rem; height: 40rem; inset-block-end: -18rem; inset-inline-end: -10rem; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.14), transparent); }
.auth-edge { position: absolute; z-index: -1; inset-block-end: 0; inset-inline-end: 0; width: min(38vw, 20rem); opacity: 0.55; pointer-events: none; }
html[dir="ltr"] .auth-edge { transform: scaleX(-1); }

.auth-top { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.25rem; }
/* The language button and the light/dark toggle (app.js) sit together at the top bar's end. */
.auth-top-tools { display: flex; align-items: center; gap: 0.5rem; }
.auth .btn-outline:not(.auth-card *):not(.start-card *), .auth-tools > summary { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: var(--color-on-brand-field); }
.auth .btn-outline:not(.auth-card *):not(.start-card *):hover, .auth-tools > summary:hover { background: rgba(255, 255, 255, 0.18); }
.auth :focus-visible { outline-color: var(--color-accent); }

.auth-main { flex: 1; display: grid; place-items: center; padding: 0.5rem 1rem 1.5rem; }

/* The white cards on the field. */
.auth-card, .start-card {
  border-radius: 1.5rem; color: var(--color-text);
  background: color-mix(in srgb, var(--color-bg-surface) 92%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 40px 80px -36px rgba(0, 0, 0, 0.6);
}
.auth-card :focus-visible, .start-card :focus-visible { outline-color: var(--color-focus); }
.auth-card { width: 100%; max-width: 23rem; padding: 2rem 1.75rem 1.75rem; }
.start-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1.5rem; }
@media (max-width: 400px) { .auth-card { padding: 1.5rem 1.25rem 1.25rem; border-radius: 1.25rem; } }

/* The bank on top of a sign-in card: its logo, then the portal's name. */
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 0.625rem; margin-bottom: 1.5rem; text-align: center; }
.auth-brand .bank-logo { width: 3.25rem; height: 3.25rem; }
.auth-brand-name { font-size: 0.8125rem; color: var(--color-text-muted); }
.auth-title { font-size: 1.5rem; font-weight: 700; line-height: 1.3; text-align: center; }
.auth-sub { margin-top: 0.25rem; font-size: 0.875rem; color: var(--color-text-muted); text-align: center; }

/* The six-digit code: large, spaced, centred. */
.auth-code { font-size: 1.75rem; letter-spacing: 0.5em; text-align: center; padding-inline-start: 0.5em; }

/* The start page's bank logo sits on a white pill; the "prototype" note is a pill on the field. */
.start-bank { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.375rem 0.875rem; border-radius: 999px; color: var(--color-text); background: rgba(255, 255, 255, 0.92); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.5); }
.start-pill { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25); }

.auth-foot { position: relative; display: flex; align-items: center; justify-content: center; padding: 1rem 1.25rem 1.25rem; }
.auth-foot .product-endorsement { color: var(--color-on-brand-field-muted); }
/* Demo tools: a small control at the footer's start that opens upwards. */
.auth-tools { position: absolute; inset-inline-start: 1.25rem; inset-block-end: 1.25rem; }
.auth-tools > summary { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.25rem; padding: 0 0.75rem; border: 1px solid; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; cursor: pointer; list-style: none; }
.auth-tools > summary::-webkit-details-marker { display: none; }
.auth-tools-panel { position: absolute; inset-inline-start: 0; inset-block-end: calc(100% + 0.5rem); width: min(20rem, calc(100vw - 2.5rem)); padding: 1rem; border-radius: 1rem; color: var(--color-text); background: var(--color-glass-solid); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border: 1px solid var(--color-glass-border); box-shadow: var(--shadow-dialog); }
.auth-tools-panel :focus-visible { outline-color: var(--color-focus); }
@media (max-width: 640px) {
  .auth-foot { flex-direction: column-reverse; gap: 0.75rem; }
  .auth-tools { position: static; }
  .auth-tools-panel { inset-inline-start: 50%; transform: translateX(-50%); }
  html[dir="rtl"] .auth-tools-panel { transform: translateX(50%); }
}

/* Dark mode (tokens in ui.css): the field keeps the bank's own colour, a little deeper; the cards turn to dark glass
   with a faint rim; the start page's bank pill stays a light plate for the bank's logo. */
@media screen {
  :root[data-mode="dark"] .auth { background: linear-gradient(165deg, color-mix(in srgb, var(--color-brand-deep) 80%, #000) 0%, color-mix(in srgb, var(--color-brand-deep) 45%, #000) 100%); }
  :root[data-mode="dark"] .auth-card, :root[data-mode="dark"] .start-card { background: color-mix(in srgb, var(--color-bg-surface) 88%, transparent); border-color: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 80px -36px rgba(0, 0, 0, 0.8); }
  :root[data-mode="dark"] .start-bank { background: #f4f7f9; color: #24384a; }
  :root[data-mode="dark"] .start-bank .bank-mark, :root[data-mode="dark"] .start-bank .bank-logo-full { background: none; padding: 0; }
}

/* Dialogs opened from these pages sit on the light glass, not on the colour field. */
.auth .dialog { color: var(--color-text); }
.auth .dialog :focus-visible { outline-color: var(--color-focus); }
