/* =========================================================
   Diction Masters — shared chrome
   Design idea: an open exercise book meets a chalkboard.
   Tokens, reset, buttons, header and footer live here so every
   page (landing, auth, dashboards) shares one visual language.
   ========================================================= */

:root {
  --ink: #0b1a4a;
  --ink-70: rgba(11, 26, 74, 0.72);
  --ink-40: rgba(11, 26, 74, 0.4);
  --rule: rgba(11, 26, 74, 0.12);

  --parchment: #f2f5fc;
  --parchment-deep: #e7effe;

  --gold: #e9ae00;
  --gold-deep: #3D63E6;
  --gold-tint: rgba(233, 174, 0, 0.14);

  --green: #3D63E6;
  --green-deep: #1846E0;

  --maroon: #1846E0;
  --maroon-deep: #1846E0;

  --charcoal: #0b1a4a;
  --paper-white: #ffffff;

  --font-serif: "Plus Jakarta Sans", "Noto Sans", system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1320px;
  --radius: 6px;
}

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--paper-white);
  line-height: 1.55;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-serif);
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
}

p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- messages (django.contrib.messages) ---------- */

.messages {
  list-style: none;
  margin: 0;
  padding: 14px 0;
}
.messages .wrap { display: flex; flex-direction: column; gap: 10px; }
.message {
  padding: 13px 18px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  border: 1px solid var(--rule);
}
.message--success { background: #F2F5FC; border-color: #D6E3FF; color: #1846E0; }
.message--error { background: #FFE9A8; border-color: #E9AE00; color: var(--maroon-deep); }
.message--info, .message--warning { background: var(--gold-tint); border-color: var(--gold); color: var(--gold-deep); }

/* ---------- buttons & links ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }

.btn--maroon {
  background: var(--maroon);
  color: var(--paper-white);
}
.btn--maroon:hover { background: var(--maroon-deep); }

.btn--gold {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--gold:hover { background: var(--ink); color: var(--parchment); }

.btn--green {
  background: var(--green);
  color: var(--paper-white);
}
.btn--green:hover { background: var(--green-deep); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  padding-left: 4px;
  padding-right: 4px;
  border-bottom: 1px solid var(--ink-40);
  border-radius: 0;
}
.btn--ghost:hover { border-color: var(--ink); }

.btn--large { padding: 16px 30px; font-size: 1.02rem; }
.btn--full { width: 100%; text-align: center; }
.btn--small { padding: 9px 16px; font-size: 0.86rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.link-quiet {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  opacity: 0.85;
}
.link-quiet:hover { opacity: 1; }

/* ---------- header ---------- */

.site-header {
  background: var(--parchment);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand__mark { color: var(--gold-deep); display: flex; }
.brand__logo { display: block; height: 40px; width: auto; max-width: 220px; object-fit: contain; }
.brand__name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
}
.brand__name--light { color: var(--parchment); }

.main-nav {
  display: flex;
  gap: 28px;
  font-size: 0.95rem;
}
.main-nav a { text-decoration: none; color: var(--ink-70); }
.main-nav a:hover { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.95rem;
}

.phonemic-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 8px;
  border: 1.4px solid var(--rule);
  background: var(--paper-white);
  text-decoration: none;
  line-height: 1;
  transition: border-color 0.15s ease;
}
.phonemic-icon-btn:hover { border-color: var(--gold); }
.phonemic-icon-btn__row { display: flex; gap: 3px; }
.phonemic-icon-btn__sym {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 10px;
}
.phonemic-icon-btn__sym--accent { color: var(--gold-deep); }
.phonemic-icon-btn__sym--muted { color: var(--ink-40); }

@media (max-width: 860px) {
  .main-nav { display: none; }
}

@media (max-width: 560px) {
  .site-header__inner { height: auto; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; row-gap: 12px; }
  .brand { width: 100%; }
  .header-actions { width: 100%; justify-content: space-between; }
}

/* ---------- footer ---------- */

.site-footer { background: var(--ink); color: rgba(242, 245, 252, 0.85); padding: 56px 0 28px; }
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(242, 245, 252, 0.15);
}
.site-footer__brand p { margin-top: 8px; font-size: 0.9rem; color: rgba(242, 245, 252, 0.6); max-width: 32ch; }
.site-footer__links { display: flex; gap: 24px; flex-wrap: wrap; align-self: center; font-size: 0.92rem; }
.site-footer__links a { text-decoration: none; color: rgba(242, 245, 252, 0.8); }
.site-footer__links a:hover { color: var(--parchment); }
.site-footer__copyright {
  max-width: var(--wrap);
  margin: 20px auto 0;
  padding: 0 28px;
  font-size: 0.8rem;
  color: rgba(242, 245, 252, 0.45);
}

/* ---------- show / hide a password (static/js/password_toggle.js) ---------- */

/* ---------- choosing a password (static/js/password_strength.js) ---------- */

.pw-guide { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(11, 26, 74, 0.04); border: 1px solid var(--rule); }
.pw-guide.is-accepted { background: rgba(15, 49, 174, 0.07); border-color: rgba(15, 49, 174, 0.35); }
.pw-meter { display: flex; align-items: center; gap: 10px; }
.pw-meter__bar { flex: 1 1 auto; height: 7px; border-radius: 999px; background: rgba(11, 26, 74, 0.12); overflow: hidden; }
.pw-meter__fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--maroon); transition: width 0.25s ease, background 0.25s ease; }
.pw-guide[data-score="2"] .pw-meter__fill { background: var(--gold); }
.pw-guide[data-score="3"] .pw-meter__fill,
.pw-guide[data-score="4"] .pw-meter__fill { background: var(--green); }
.pw-meter__word { flex: 0 0 auto; font-size: 0.82rem; font-weight: 600; color: var(--ink-70); }
.pw-guide.is-accepted .pw-meter__word { color: var(--green); }

.pw-rules { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 14px; }
.pw-rule { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--ink-40); }
.pw-rule__mark { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; }
.pw-rule.is-met { color: var(--green); }
.pw-rule.is-met .pw-rule__mark { background: var(--green); border-color: var(--green); }
.pw-rule.is-met .pw-rule__mark::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pw-rule.is-missing { color: var(--maroon); }

.pw-example { margin: 10px 0 0; font-size: 0.82rem; color: var(--ink-70); }
.pw-example strong { color: var(--ink); font-weight: 600; }
.pw-make { margin-top: 10px; padding: 7px 12px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.pw-make:hover { border-color: var(--gold); color: var(--gold-deep); }
.pw-made { margin: 8px 0 0; font-size: 0.85rem; color: var(--green); }
.pw-made strong { font-family: var(--font-sans); letter-spacing: 0.02em; }
.pw-match { margin: 6px 0 0; font-size: 0.82rem; }
.pw-match.is-same { color: var(--green); }
.pw-match.is-different { color: var(--maroon); }
@media (prefers-reduced-motion: reduce) { .pw-meter__fill { transition: none; } }

.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  display: grid; place-items: center;
  width: 38px; height: 38px;
  padding: 0;
  border: 0; border-radius: 10px;
  color: var(--ink-40);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.pw-toggle:hover { color: var(--ink); background: rgba(11, 26, 74, 0.06); }
.pw-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pw-toggle[aria-pressed="true"] { color: var(--gold-deep); }
