/* The account pages (sign-in, two-step, forgot, reset and set password,
 * error, privacy) live outside the React shell, so they carry their own
 * stylesheet rather than sharing the application's. One file serves both
 * text directions: every direction-dependent declaration uses a logical
 * property, and directional icons are flipped with .account-flip-rtl.
 */

/* Tokens mirrored from App/src/styles/tokens.css (D-149). This subset is a
 * copy: change a value here only when tokens.css changes the same value.
 */
:root {
  --teal-50: #f0f7f6;
  --teal-100: #dbeceb;
  --teal-200: #b5d7d4;
  --teal-600: #1e756d;
  --teal-700: #185f59;
  --teal-800: #134a45;
  --cyan-500: #22d3ee;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --green-50: #ecfdf3;
  --green-100: #d1fadf;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --white: #ffffff;
  --brand-primary: var(--teal-600);
  --brand-accent: var(--cyan-500);
  --brand-tint: rgba(30, 117, 109, 0.08);
  --bg-app: var(--slate-50);
  --bg-surface: var(--white);
  --bg-inverse: var(--slate-900);
  --border-subtle: var(--slate-200);
  --border-default: var(--slate-300);
  --text-primary: var(--slate-900);
  --text-secondary: var(--slate-500);
  --text-tertiary: var(--slate-400);
  --text-inverse: var(--white);
  --text-link: var(--teal-600);
  --text-link-hover: var(--teal-700);
  --focus-ring: var(--teal-600);
  --font-display: 'Inter Variable', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter Variable', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14), 0 4px 10px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 3px rgba(30, 117, 109, 0.25);
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --tracking-tight: -0.015em;
  --leading-relaxed: 1.65;
  --account-night: #0f1b21;
  --account-night-lift: #1a2b32;
  --account-mist: #5eead4;
  --account-accent: #2dd4bf;
  --account-night-text: #f4faf9;
  --account-night-muted: #b7c4c9;
  --account-night-faint: #93a3a9;
}

:root[lang='ar'] {
  --font-display: 'Tajawal', 'Inter Variable', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Tajawal', 'Inter Variable', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* Self-hosted Inter Variable, latin and latin-ext only. The unicode ranges
 * are the latin and latin-ext blocks from
 * App/node_modules/@fontsource-variable/inter/index.css (the per-subset
 * latin.css/latin-ext.css files the architecture names do not exist in this
 * tree; index.css carries the same blocks).
 */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Self-hosted Tajawal, arabic only. The per-weight arabic-*.css files in
 * App/node_modules/@fontsource/tajawal declare no unicode range, so the
 * arabic block below is the Tajawal arabic block from the design's
 * global-styles.css.
 */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/tajawal-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('../fonts/tajawal-arabic-500-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../fonts/tajawal-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* Base. The account pages sit on the dark night surface; cards are white. */
html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--account-night);
  background-image:
    radial-gradient(circle at 18% 10%, rgba(45, 212, 191, 0.16), transparent 44%),
    radial-gradient(circle at 85% 90%, rgba(45, 212, 191, 0.1), transparent 40%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Only icons that point somewhere are mirrored in RTL. */
[dir='rtl'] .account-flip-rtl {
  transform: scaleX(-1);
}

.account-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-block-size: 0;
}

.account-footer {
  padding-block: 18px;
  padding-inline: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--account-night-faint);
}

.account-footer a {
  color: var(--account-mist);
}

.account-footer a:hover {
  color: var(--account-night-text);
}

/* Who is signed in, and the way out, on the few Razor pages a signed-in
 * person can reach (Privacy, Error). */
.account-footer-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-footer-signout {
  display: inline;
  margin-block: 0;
  margin-inline: 0;
}

.account-footer-signout button {
  padding-block: 0;
  padding-inline: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--account-mist);
  text-decoration: underline;
  cursor: pointer;
}

.account-footer-signout button:hover {
  color: var(--account-night-text);
}

/* Sign-in split: the brand panel sits at the inline start, the form panel
 * centres the card. Grid column order follows text direction, so no
 * direction-specific rule is needed.
 */
.signin {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(440px, 520px);
  min-block-size: 100vh;
  font-family: var(--font-body);
}

.signin-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding-block: clamp(40px, 5vw, 72px);
  padding-inline: clamp(40px, 5vw, 72px);
  background-color: var(--account-night);
  background-image:
    radial-gradient(circle at 18% 10%, rgba(45, 212, 191, 0.16), transparent 44%),
    radial-gradient(circle at 85% 90%, rgba(45, 212, 191, 0.1), transparent 40%);
}

.signin-art {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.signin-brand-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-inline-size: 620px;
}

.signin-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding-block: 7px;
  padding-inline: 15px 12px;
  border: 1px solid rgba(45, 212, 191, 0.38);
  border-radius: var(--radius-full);
  background-color: rgba(45, 212, 191, 0.1);
  color: var(--account-mist);
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.signin-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.06;
  letter-spacing: var(--tracking-tight);
  color: var(--account-night-text);
  text-wrap: balance;
}

.signin-heading-accent {
  color: var(--account-accent);
}

.signin-rule {
  inline-size: 54px;
  block-size: 3px;
  border-radius: 2px;
  background-color: var(--account-accent);
  margin-block-start: 18px;
}

.signin-lede {
  max-inline-size: 46ch;
  font-size: 16px;
  line-height: var(--leading-relaxed);
  color: var(--account-night-muted);
  text-wrap: pretty;
}

.signin-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.signin-feature {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-inline-size: 0;
}

.signin-feature-icon {
  inline-size: 42px;
  block-size: 42px;
  border: 1px solid rgba(45, 212, 191, 0.38);
  border-radius: var(--radius-full);
  background-color: rgba(45, 212, 191, 0.14);
  color: var(--account-mist);
  display: grid;
  place-items: center;
}

.signin-feature-title {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 14.5px;
  color: var(--account-night-text);
}

.signin-feature-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--account-night-faint);
  text-wrap: pretty;
}

.signin-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 28px);
  padding-block: clamp(24px, 3vw, 48px);
  padding-inline: clamp(24px, 3vw, 48px);
  background-color: var(--bg-surface);
}

.signin-lang {
  margin-inline-start: auto;
}

.signin-lang-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 38px;
  padding-block: 0;
  padding-inline: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.signin-lang-button:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* The sign-in card: a dark header over a white body. */
.signin-card {
  inline-size: 100%;
  max-inline-size: 420px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.signin-card-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding-block: clamp(24px, 2.6vw, 32px) 22px;
  padding-inline: clamp(28px, 3vw, 40px);
  background-color: var(--account-night);
  border-start-start-radius: var(--radius-xl);
  border-start-end-radius: var(--radius-xl);
}

.signin-card-logo {
  inline-size: 194px;
  block-size: 46px;
  object-fit: contain;
}

.signin-compact {
  display: none;
  align-items: center;
  gap: 7px;
  color: var(--account-mist);
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.signin-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 25px;
  letter-spacing: var(--tracking-tight);
  color: var(--account-night-text);
}

.signin-card-subtitle {
  margin-block-start: 5px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--account-night-muted);
}

.signin-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-block: clamp(24px, 3vw, 32px) clamp(28px, 3vw, 40px);
  padding-inline: clamp(28px, 3vw, 40px);
}

.signin-card-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Fields with a leading icon and an optional show/hide button. */
.account-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.account-label {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.account-control {
  position: relative;
  display: flex;
  align-items: center;
}

.account-control-icon {
  position: absolute;
  inset-inline-start: 13px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  pointer-events: none;
}

.account-input {
  inline-size: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding-block: 13px;
  padding-inline: 42px 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.account-input::placeholder {
  color: var(--text-tertiary);
}

.account-input:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-focus);
}

/* Email and code inputs are left to right (D-105) while their icon follows
 * the page. In an Arabic page the icon sits at the right, so the gap moves
 * there too, or a long address runs under the icon. */
[dir='rtl'] .account-input[dir='ltr'] {
  padding-inline: 14px 42px;
}

.account-control-has-toggle .account-input {
  padding-inline-end: 46px;
}

.account-toggle {
  position: absolute;
  inset-inline-end: 6px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  inline-size: 34px;
  block-size: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.account-toggle:hover {
  color: var(--brand-primary);
  background-color: var(--brand-tint);
}

/* The toggle starts hidden so the page works without JavaScript. Author
 * display rules override the UA [hidden] rule, so it is restored here.
 */
.account-toggle[hidden],
.account-toggle svg[hidden] {
  display: none;
}

.account-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.account-field-error {
  font-size: 12.5px;
  color: var(--red-600);
}

/* Remember-me row. */
.signin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.account-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
}

.account-check-input {
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.signin-forgot {
  margin-inline-start: auto;
  font-size: 13px;
  font-weight: var(--weight-medium);
}

/* Full-width dark submit button. */
.account-submit {
  inline-size: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-block-size: 52px;
  padding-block: 0;
  padding-inline: 22px;
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: var(--radius-md);
  background-color: var(--account-night);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.account-submit:hover {
  background-color: var(--account-night-lift);
  border-color: rgba(45, 212, 191, 0.75);
}

/* The global two-pixel outline stays: the halo alone is too faint against
 * the white card (WCAG 1.4.11). */
.account-submit:focus-visible {
  box-shadow: var(--shadow-focus);
}

a.account-submit:hover {
  color: var(--text-inverse);
  text-decoration: none;
}

/* Tinted notes: success green, info teal, error red. */
.account-note {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding-block: 10px;
  padding-inline: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

.account-note-success {
  background-color: var(--green-50);
  border-color: var(--green-100);
  color: var(--green-700);
}

.account-note-info {
  background-color: var(--teal-50);
  border-color: var(--teal-100);
  color: var(--teal-800);
}

.account-note-error {
  background-color: var(--red-50);
  border-color: var(--red-100);
  color: var(--red-700);
}

/* The validation summary renders an empty element when there is nothing
 * to report; it takes no space until it carries a message.
 */
.account-note:empty {
  display: none;
}

/* Centred card for the two-step, forgot, reset, set-password, error and
 * privacy pages: the dark page with a white card at most 420 px wide.
 */
.account-centred {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(24px, 3.4vw, 40px);
  padding-inline: 16px;
}

.account-card {
  inline-size: 100%;
  max-inline-size: 420px;
  box-sizing: border-box;
  background-color: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.account-card-logo {
  display: block;
  block-size: 40px;
  inline-size: auto;
  max-inline-size: 100%;
  object-fit: contain;
  object-position: center;
  margin-block-end: 18px;
}

.account-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-block-end: 18px;
}

.account-back:hover {
  color: var(--text-link-hover);
}

.account-card > .account-back:last-child {
  margin-block-end: 0;
}

.account-title {
  margin: 0;
  margin-block-end: 4px;
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: 22px;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.account-lede {
  margin: 0;
  margin-block-end: 22px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.account-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding-block: 12px;
}

.account-sent-badge {
  inline-size: 56px;
  block-size: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background-color: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-600);
}

.account-sent .account-title,
.account-sent .account-lede {
  margin: 0;
}

.account-sent .account-submit {
  margin-block-start: 4px;
}

.account-resend {
  margin: 0;
}

.account-link-button {
  padding: 0;
  border: 0;
  background-color: transparent;
  color: var(--text-link);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.account-link-button:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

.account-card > .account-lede:last-child,
.account-card > .account-request-id:last-child {
  margin-block-end: 0;
}

.account-request-id {
  font-size: 14px;
  color: var(--text-secondary);
}

@media (max-width: 1100px) {
  .signin-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .signin {
    grid-template-columns: 1fr;
  }

  .signin-brand {
    display: none;
  }

  .signin-compact {
    display: inline-flex;
  }

  .signin-form {
    align-items: stretch;
    justify-content: flex-start;
    padding-block: 28px 40px;
    padding-inline: 16px;
  }

  .signin-card {
    max-inline-size: none;
  }

  .account-centred {
    align-items: flex-start;
    padding-block: 28px;
  }

  .account-card {
    max-inline-size: none;
  }
}
