/*
 * onz.one — the public face.
 *
 * The landing page, registration, login and the download portal share one
 * palette and one type pairing. They live here rather than inline on each
 * page so that changing the brand is one edit, not six — and so a page added
 * later inherits the look instead of approximating it.
 *
 * The admin panel is deliberately NOT covered: it keeps Cairo and Tailwind's
 * defaults. A dense data tool and a marketing page want different things.
 */

/* Border-box everywhere. Without it `width: 100%` on any control that also
   has padding and a border resolves wider than its parent — which is exactly
   how the Google button pushed a 390px phone into sideways scrolling. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* teal, deep to light */
  --b-deep:      #06282e;
  --b-deep-2:    #0a3d48;
  --b-mid:       #0f6b5c;
  --b-ink:       #06282e;

  /* mint — the accent that carries every call to action */
  --b-mint:      #3ddc97;
  --b-mint-soft: #d9f7ea;
  --b-mint-deep: #0f9e6e;

  /* the single warm contrast, used sparingly */
  --b-amber:     #ffb43d;
  --b-amber-ink: #3d2600;

  /* neutrals, tinted toward the teal so nothing reads as plain grey */
  --b-page:      #f0faf6;
  --b-surface:   #ffffff;
  --b-line:      #d9e7e2;
  --b-body:      #557370;
  --b-faint:     #7a8f8b;

  --b-display: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --b-sans: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --b-mono: "IBM Plex Mono", ui-monospace, monospace;

  --b-radius: 18px;
  --b-radius-lg: 30px;
}

/* ---------------------------------------------------------- page shell */

.b-page {
  margin: 0;
  background: var(--b-page);
  color: var(--b-ink);
  font-family: var(--b-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.b-shell {
  max-width: 940px;
  margin: 0 auto;
  padding-inline: 20px;
  padding-block: 48px 64px;
}
.b-shell--narrow { max-width: 560px; }

/* ---------------------------------------------------------- type */

.b-display {
  font-family: var(--b-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}
.b-h1 { font-size: clamp(28px, 4.4vw, 40px); }
.b-h2 { font-size: clamp(22px, 3vw, 28px); }

.b-lede { color: var(--b-body); font-weight: 300; margin: 10px 0 0; }
.b-muted { color: var(--b-faint); font-size: 13.5px; }
.b-mono { font-family: var(--b-mono); direction: ltr; }

/* ---------------------------------------------------------- surfaces */

.b-card {
  background: var(--b-surface);
  border-radius: var(--b-radius-lg);
  padding: 34px;
  box-shadow: 0 1px 2px rgba(6, 40, 46, .04), 0 24px 48px -32px rgba(6, 40, 46, .3);
}

.b-note {
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14.5px;
}
.b-note--info  { background: var(--b-mint-soft); color: #0a5943; }
.b-note--warn  { background: #fff4e0; color: #7a4d00; }
.b-note--error { background: #fdeaea; color: #8f2020; }

/* ---------------------------------------------------------- forms */

.b-field { display: block; margin-bottom: 18px; }

.b-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--b-ink);
}

.b-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 15.5px;
  color: var(--b-ink);
  background: var(--b-surface);
  border: 1.5px solid var(--b-line);
  border-radius: 12px;
  padding: 13px 16px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.b-input:hover { border-color: #bcd6cf; }
.b-input:focus {
  outline: none;
  border-color: var(--b-mint-deep);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, .18);
}
.b-input::placeholder { color: #a8b8b4; }

.b-hint { font-size: 12.5px; color: var(--b-faint); margin: 6px 0 0; }

/* "optional" next to a label, so the required fields need no marker at all. */
.b-label-note {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--b-faint);
  margin-inline-start: 6px;
}

/* A field the server rejected. Colour alone would not carry to a colour-blind
   reader, so the message above the form names the field too. */
.b-input[aria-invalid="true"] {
  border-color: #d4573f;
  background: #fff8f6;
}
.b-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(212, 87, 63, .16);
}

/* Secondary navigation that must not compete with the page's one action. */
.b-link-quiet {
  font-size: 14px;
  font-weight: 500;
  color: var(--b-faint);
  text-decoration: none;
}
.b-link-quiet:hover { color: var(--b-ink); text-decoration: underline; }

/* ---------------------------------------------------------- buttons */

.b-btn {
  display: inline-block;
  font-family: var(--b-display);
  font-weight: 800;
  font-size: 16px;
  padding: 15px 32px;
  border-radius: 100px;
  border: 2px solid transparent;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.b-btn:active { transform: translateY(1px); }
.b-btn--block { display: block; width: 100%; }

.b-btn--primary {
  background: var(--b-mint);
  color: var(--b-deep);
  box-shadow: 0 12px 30px -12px rgba(61, 220, 151, .6);
}
.b-btn--primary:hover { box-shadow: 0 16px 34px -12px rgba(61, 220, 151, .7); }

.b-btn--dark { background: var(--b-deep); color: #ffffff; }

.b-btn--ghost {
  background: transparent;
  color: var(--b-ink);
  border-color: var(--b-line);
}
.b-btn--ghost:hover { border-color: var(--b-mint-deep); }

/* Focus must stay visible for keyboard users; the shadow above is hover
   feedback, not a focus ring. */
.b-btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--b-mint-deep);
  outline-offset: 3px;
}

/* ---------------------------------------------------------- misc */

.b-link { color: var(--b-mid); text-decoration: none; font-weight: 500; }
.b-link:hover { text-decoration: underline; }

.b-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--b-faint);
  font-size: 13.5px;
  margin: 26px 0;
}
.b-divider::before,
.b-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--b-line);
}

.b-brand {
  font-family: var(--b-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--b-ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.b-brand span { color: var(--b-mint-deep); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* On a phone, 34px of card padding either side costs a fifth of the screen. */
@media (max-width: 520px) {
  .b-card { padding: 24px 20px; border-radius: 22px; }
  .b-shell { padding-block: 30px 44px; }
}
