@font-face {
  font-family: "RTA Office";
  src: url("/fonts/RTA_Office-Regular.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #2e0f5c;
  --navy-2: #4a1a85;
  --navy-3: #220a47;
  --on-dark-muted: #d6c9ee;
  --soon: #c7bbdc;
  --shadow: 46, 15, 92;
  --grey: #6b7280;
  --grey-light: #f5f2fa;
  --line: #e6dff0;
  --red: #c8102e;
  --white: #ffffff;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: "RTA Office", "Segoe UI", Tahoma, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body { min-height: 100dvh; }

button, input { font: inherit; }

/* ---------- Header ---------- */
.topbar {
  background: var(--navy);
  color: var(--white);
  padding: calc(14px + var(--safe-top)) 18px 22px;
  border-bottom: 4px solid var(--red);
}
.topbar-row { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; }
.topbar img { width: 44px; height: 44px; border-radius: 12px; }
.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 700; }
.topbar p { margin: 2px 0 0; font-size: .85rem; color: var(--on-dark-muted); }
.topbar .spacer { flex: 1; }
.icon-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--white);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: .85rem;
  cursor: pointer;
}

/* ---------- Tiles ---------- */
main { max-width: 760px; margin: 0 auto; padding: 22px 16px calc(28px + var(--safe-bottom)); }
.section-title { font-size: .95rem; color: var(--grey); margin: 0 4px 12px; font-weight: 400; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 150px;
  padding: 18px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(var(--shadow), .06);
  color: var(--navy);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.tile:active { transform: scale(.97); }
a.tile:hover { box-shadow: 0 6px 18px rgba(var(--shadow), .12); }

.tile .ico {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--navy);
  color: var(--white);
}
.tile .ico svg { width: 28px; height: 28px; }
.tile h2 { font-size: 1rem; margin: 0; line-height: 1.5; font-weight: 700; }
.tile p { font-size: .8rem; margin: 0; color: var(--grey); line-height: 1.6; }
.tile::after {
  content: ""; position: absolute; inset-inline-start: 16px; top: 0;
  width: 28px; height: 3px; background: var(--red); border-radius: 0 0 3px 3px;
}

.tile.soon { background: var(--grey-light); border-style: dashed; box-shadow: none; cursor: default; }
.tile.soon .ico { background: var(--soon); }
.tile.soon::after { background: var(--soon); }
.badge {
  position: absolute; top: 14px; inset-inline-end: 14px;
  font-size: .72rem; padding: 3px 10px; border-radius: 999px;
  background: var(--white); color: var(--grey); border: 1px solid var(--line);
}

footer { text-align: center; color: var(--grey); font-size: .75rem; margin-top: 28px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  background: linear-gradient(180deg, var(--navy) 0 38%, var(--white) 38%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--white);
  border-radius: 22px;
  border-top: 4px solid var(--red);
  box-shadow: 0 12px 34px rgba(var(--shadow), .18);
  padding: 28px 22px 24px;
  text-align: center;
}
.login-card img { width: 84px; height: 84px; border-radius: 20px; margin-top: -70px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.login-card h1 { font-size: 1.25rem; margin: 16px 0 4px; }
.login-card p { color: var(--grey); font-size: .85rem; margin: 0 0 22px; }
.field { text-align: start; }
.field label { display: block; font-size: .85rem; margin-bottom: 6px; color: var(--navy-2); }
.field input {
  width: 100%; padding: 13px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; color: var(--navy);
  direction: ltr; text-align: right;
}
.field input:focus { outline: 2px solid var(--navy); outline-offset: 1px; background: var(--white); }
.primary {
  margin-top: 18px; width: 100%; padding: 13px; border: 0; border-radius: 12px;
  background: var(--navy); color: var(--white); font-size: 1rem; cursor: pointer;
}
.primary:disabled { opacity: .6; }
.login-card .error { color: var(--red); font-size: .85rem; min-height: 1.4em; margin: 12px 0 0; }

.tile .ico.img { background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.tile .ico.img img { width: 40px; height: 40px; object-fit: contain; }

/* Logo-matched purple gradient for the header and login backdrop */
.topbar { background: radial-gradient(120% 140% at 50% 110%, var(--navy-2) 0%, var(--navy) 55%, var(--navy-3) 100%); }
.login-wrap { background: radial-gradient(120% 60% at 50% 40%, var(--navy-2) 0%, var(--navy) 45%, var(--navy-3) 70%) top / 100% 38% no-repeat, var(--white); }
.primary { background: linear-gradient(180deg, var(--navy-2), var(--navy)); }

/* ---------- Fingerprint sign-in ---------- */
.bio-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 0; }
.bio-btn svg { width: 24px; height: 24px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--grey); font-size: .8rem; margin: 18px 0 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.bio-card {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding: 14px 16px;
  background: var(--grey-light); border: 1px solid var(--line); border-radius: var(--radius);
}
.bio-card div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bio-card strong { font-size: .95rem; }
.bio-card span { font-size: .8rem; color: var(--grey); }
.bio-card button {
  border: 0; border-radius: 12px; padding: 9px 18px; cursor: pointer;
  background: linear-gradient(180deg, var(--navy-2), var(--navy)); color: var(--white);
}
.bio-card.done { border-color: #b7e4c7; background: #effaf2; }
[hidden] { display: none !important; }
.login-card .diag { color: #b8b0c8; font-size: .65rem; margin: 10px 0 0; direction: ltr; }
