/* ─────────────────────────────────────────────────────────────────────
   TaxMate sign-in page (ascra_theme_2/www/login.html).

   Everything is scoped under .tm-login, so nothing here can reach the rest
   of the website. The form stays on the light tokens so it does not go
   near-black beside the blue panel when the browser prefers dark.
   Right-to-left is handled with logical
   properties, so the Arabic page needs no extra rules.
   ───────────────────────────────────────────────────────────────────── */

.tm-login {
  --bg: #f2f6fc;
  --surface: #ffffff;
  --sunk: #f7f9fe;
  --text: #0e1726;
  --muted: #5b6b85;
  --faint: #8b9ab2;
  --border: #e4eaf4;
  --border-2: #cbd6e8;
  --brand: #1552d0;
  --brand-ink: #ffffff;
  --brand-hover: #1145b4;
  --brand-soft: #e9effc;
  --gold: #c9a227;
  --panel-1: #0a2a6e;
  --panel-2: #1b63d6;
  --panel-3: #061a4a;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --bad: #c1362f;
  --bad-soft: #fdeceb;
  --field: #ffffff;

  position: fixed;
  inset: 0;
  display: flex;
  overflow: auto;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.tm-login[dir="rtl"] {
  font-family: "IBM Plex Sans Arabic", Inter, system-ui, sans-serif;
}

/* The script hides panels with the `hidden` attribute, but the rules below
   set `display` on those same elements, and an author rule beats the user
   agent's `[hidden] { display: none }` whatever its specificity. Restate it
   here so `hidden` keeps working without depending on a global reset. */
.tm-login [hidden] { display: none !important; }

.tm-login .tm-ic {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Brand panel ───────────────────────────────────────────────────── */

.tm-panel {
  position: relative;
  flex: 0 0 47%;
  max-width: 660px;
  padding: 48px 52px 40px;
  color: #eaf1ff;
  background: linear-gradient(150deg, var(--panel-1) 0%, var(--panel-2) 52%, var(--panel-3) 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tm-panel-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tm-panel > *:not(.tm-panel-art) { position: relative; }

/* Beat ascra_portal.css (h1–h6) and taxmate_brand.css (.tm-brand), which load
   on every website page and would otherwise paint this panel dark. */
.tm-login h1,
.tm-login h2 { color: inherit; font-family: inherit; }
.tm-login .tm-brand,
.tm-login .tm-brand-name,
.tm-login .tm-word {
  color: #eaf1ff;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -.015em;
  text-decoration: none;
}

.tm-brand { display: flex; align-items: center; gap: 13px; }
.tm-brand-logo { height: 44px; width: auto; border-radius: 12px; }
.tm-brand-tile {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(160deg, #12786e, #0a423e);
  border: 1px solid rgba(255, 255, 255, .25);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: #fff;
}
.tm-brand-name { display: flex; align-items: baseline; gap: 11px; }
.tm-word { font-size: 26px; font-weight: 700; letter-spacing: -.015em; }
.tm-rule { width: 1px; height: 18px; background: rgba(255, 255, 255, .3); }
.tm-gulf { font-size: 11px; font-weight: 600; letter-spacing: .34em; color: var(--gold); }

.tm-hero { margin-top: 46px; }
.tm-hero h2 {
  margin: 0; max-width: 470px;
  font-size: 42px; line-height: 1.12; font-weight: 700; letter-spacing: -.035em;
}
.tm-hero p {
  margin: 15px 0 0; max-width: 420px;
  font-size: 15.5px; line-height: 1.6; color: rgba(255, 255, 255, .76);
}

.tm-card {
  margin-top: 32px; max-width: 430px; padding: 18px 20px; border-radius: 16px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 18px 44px rgba(3, 14, 44, .32);
}
.tm-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tm-card-t { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.tm-card-chip {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .9);
}
.tm-card-r {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 6px 0; font-size: 12.5px; color: rgba(255, 255, 255, .76);
}
.tm-card-r b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.tm-card-f {
  margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .18);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.tm-card-nl { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .7); }
.tm-card-n { display: block; font-size: 23px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tm-card-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #8ff0b4; }

.tm-feats { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; max-width: 460px; }
.tm-feats li { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .72); }
.tm-feats b { color: #fff; font-weight: 600; }
.tm-tick {
  width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px; color: #fff;
  background: rgba(255, 255, 255, .16); display: inline-flex; align-items: center; justify-content: center;
}

.tm-trust {
  margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-size: 12.5px; color: rgba(255, 255, 255, .7);
}

/* ── Form panel ────────────────────────────────────────────────────── */

.tm-form-side {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding: 28px 40px 26px;
}

.tm-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.tm-seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px;
  background: var(--sunk); border: 1px solid var(--border);
}
.tm-seg a {
  height: 30px; padding: 0 11px; border-radius: 7px; display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.tm-seg a:hover { color: var(--text); }
.tm-seg a[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-2); }
.tm-help { font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tm-help:hover { color: var(--text); }

.tm-form-wrap { margin: auto 0; display: flex; justify-content: center; }
.tm-form { width: 100%; max-width: 384px; display: flex; flex-direction: column; gap: 18px; }
.tm-form h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.tm-sub { margin: 7px 0 0; font-size: 13.5px; color: var(--muted); }
.tm-hint { margin: 7px 0 0; font-size: 12px; color: var(--muted); }

.tm-field { display: block; }
.tm-field label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; }
/* Password field: "Forgot?" is last in source order (so Tab reads
   email → password → forgot) but is placed back up on the label row. */
.tm-field-pass { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 10px; }
.tm-field-pass > label { grid-area: 1 / 1; }
.tm-field-pass > #tm-forgot { grid-area: 1 / 2; justify-self: end; }
.tm-field-pass > .tm-input-wrap { grid-area: 2 / 1 / 3 / 3; }
.tm-input-wrap { position: relative; display: flex; align-items: center; }
.tm-input {
  width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border-2); background: var(--field);
  color: var(--text); font: inherit; font-size: 14.5px;
}
/* Keep the typed password clear of the show/hide button sitting over it. */
.tm-input-wrap .tm-input { padding-inline-end: 46px; }
.tm-input::placeholder { color: var(--faint); }
.tm-input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.tm-otp { letter-spacing: .3em; font-variant-numeric: tabular-nums; }

.tm-eye {
  position: absolute; inset-inline-end: 8px; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tm-eye:hover { background: var(--brand-soft); color: var(--text); }

.tm-btn {
  width: 100%; box-sizing: border-box; height: 48px; border-radius: 10px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  text-decoration: none;
}
.tm-btn:hover { background: var(--brand-soft); }
.tm-btn-p { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tm-btn-p:hover { background: var(--brand-hover); }
.tm-btn:disabled { opacity: .75; cursor: default; }

.tm-btn:focus-visible,
.tm-link:focus-visible,
.tm-eye:focus-visible,
.tm-seg a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.tm-link {
  border: 0; background: none; padding: 0; color: var(--brand);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.tm-link:hover { text-decoration: underline; }

.tm-alt, .tm-providers { display: flex; flex-direction: column; gap: 14px; }
.tm-providers .tm-btn img, .tm-providers .tm-btn svg { width: 18px; height: 18px; flex: none; }
.tm-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; }
.tm-divider::before, .tm-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }

.tm-alert {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.45;
}
.tm-alert .tm-ic { flex: none; margin-top: 1px; display: none; }
.tm-alert-bad .tm-ic-bad, .tm-alert-ok .tm-ic-ok { display: block; }
.tm-alert b { display: block; }
.tm-alert-bad { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad); }
.tm-alert-ok { background: var(--ok-soft); border: 1px solid var(--ok); color: var(--ok); }

.tm-spin {
  width: 17px; height: 17px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: tm-spin .7s linear infinite;
}
@keyframes tm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tm-spin { animation: none; } }

.tm-foot { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

.tm-legal {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--faint);
}
.tm-legal-links { margin-inline-start: auto; display: flex; gap: 16px; flex-wrap: wrap; }
.tm-legal a { color: var(--muted); font-weight: 500; text-decoration: none; }
.tm-legal a:hover { text-decoration: underline; }

/* ── Narrower screens ──────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .tm-panel { flex-basis: 42%; padding: 40px 36px 32px; }
  .tm-hero h2 { font-size: 34px; }
  .tm-card { display: none; }
  .tm-form-side { padding: 24px 28px 22px; }
}

@media (max-width: 820px) {
  .tm-login { position: static; min-height: 100vh; display: block; }
  .tm-panel {
    max-width: none; padding: 22px 20px 30px;
    border-radius: 0;
  }
  .tm-hero { margin-top: 20px; }
  .tm-hero h2 { font-size: 24px; }
  .tm-hero p { margin-top: 7px; font-size: 13.5px; }
  .tm-feats, .tm-trust { display: none; }
  .tm-form-side {
    margin-top: -14px; border-radius: 18px 18px 0 0;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 24px 20px 20px; min-height: 60vh;
  }
  .tm-top { justify-content: space-between; }
  .tm-form-wrap { margin: 18px 0 0; }
  .tm-form { max-width: none; }
  .tm-input, .tm-btn { height: 50px; }
  .tm-legal { margin-top: 22px; justify-content: center; }
  .tm-legal-links { margin-inline-start: 0; }
}
