/* auth.css — WP8. Auth & legal surfaces that live OUTSIDE the app shell:
 * standalone legal documents (/terms, /privacy), the GDPR cookie banner (all
 * pages incl. login), and the login-card polish (boxed message pills, the
 * password-strength meter, the pre-auth language toggle, consent checkboxes,
 * legal-links row). These pages are always light (spec-auth §11.5); values are
 * hardcoded navy (not flip-sensitive tokens) so a stray dark-mode class can
 * never leak in. Green→navy per spec-auth §10 (#252f45→#16293d, #7294b7→#526878).
 */

/* ═══════════════════════════ Legal documents (/terms, /privacy) ═══════════════════════════ */
/* spec-auth §6.1–6.3 — dark header band + content column. Terms renders on the
 * canvas; Privacy wraps content in a white elevated card. Bilingual: both
 * language blocks ship in the DOM and CSS shows the one matching <html lang>
 * (i18n.js stamps the attribute; the toggle reloads → correct after switch). */

.ct-legal {
  --legal-primary: #16293d;
  --legal-secondary: #526878;
  --legal-muted: #7a8a97;
  --legal-border: #dfe6ed;
  --legal-bg: #f4f7fa;
  --legal-body: #3a4a5c;
  background: var(--legal-bg);
  color: var(--legal-primary);
  line-height: 1.7;
  min-height: 100vh;
}

.ct-legal-header {
  background: var(--legal-primary);
  color: #fff;
  padding: 24px 16px;
  text-align: center;
}
.ct-legal-header img {
  max-width: 120px;
  height: auto;
  margin-bottom: 8px;
  /* white knockout so the navy logo reads on the dark band (design ref §5) */
  filter: brightness(0) invert(1);
}
.ct-legal-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 0;
}
.ct-legal-updated {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}

.ct-legal-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}
/* Privacy variant: elevated white card (spec-auth §6.2) */
.ct-legal-container {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 24px;
}
.ct-legal-container .ct-legal-content {
  background: #fff;
  padding: 36px 40px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(22, 41, 61, 0.08);
  max-width: none;
  margin: 0;
}

.ct-legal-content h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--legal-primary);
  margin-top: 28px;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--legal-border);
}
/* Privacy uses a top rule instead of a bottom one (spec-auth §6.2) */
.ct-legal-container .ct-legal-content h2 {
  margin: 28px 0 10px;
  padding-top: 12px;
  padding-bottom: 0;
  border-top: 1px solid var(--legal-border);
  border-bottom: none;
}
.ct-legal-container .ct-legal-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.ct-legal-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--legal-primary);
  margin: 18px 0 8px;
}
.ct-legal-content p,
.ct-legal-content li {
  font-size: 0.92rem;
  color: var(--legal-body);
  margin-bottom: 8px;
}
.ct-legal-content ul,
.ct-legal-content ol {
  padding-left: 22px;
  margin-bottom: 14px;
}
.ct-legal-content li {
  margin-bottom: 6px;
}
.ct-legal-content a {
  color: var(--legal-secondary);
  text-decoration: underline;
}
.ct-legal-highlight {
  background: rgba(82, 104, 120, 0.08);
  border: 1px solid rgba(82, 104, 120, 0.22);
  padding: 14px 18px;
  border-radius: 6px;
  margin: 14px 0;
  font-size: 0.88rem;
}
.ct-legal-back {
  display: inline-block;
  margin-top: 24px;
  color: var(--legal-secondary);
  font-size: 0.88rem;
  text-decoration: none;
}
.ct-legal-back:hover {
  text-decoration: underline;
}

/* Bilingual toggle — one language block visible at a time, keyed off <html lang>.
 * Default (before i18n stamps the attribute) shows EN so there is never a blank. */
.ct-legal [data-legal-lang="el"] {
  display: none;
}
html[lang="el"] .ct-legal [data-legal-lang="el"] {
  display: block;
}
html[lang="el"] .ct-legal [data-legal-lang="en"] {
  display: none;
}

@media (max-width: 600px) {
  .ct-legal-content {
    padding: 24px 20px;
  }
  .ct-legal-container .ct-legal-content {
    padding: 24px 22px;
  }
}

/* ═══════════════════════════ GDPR cookie banner ═══════════════════════════ */
/* spec-theme §4.1 — verbatim geometry; the eudr-x banner is already navy, so
 * only the font/accent literals are tokenized. Self-colored dark surface: no
 * dark-mode override needed. Hidden in print (spec-theme §2.7). */
#cookieConsentBanner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(11, 23, 36, 0.97);
  color: #fff;
  padding: 16px 24px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
#cookieConsentBanner .ct-cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
#cookieConsentBanner .ct-cookie-text {
  flex: 1;
  min-width: 280px;
  line-height: 1.5;
}
#cookieConsentBanner .ct-cookie-text strong {
  font-weight: 800;
}
#cookieConsentBanner .ct-cookie-text a {
  color: #8fb3cc;
  text-decoration: underline;
}
#cookieAcceptBtn {
  background: #526878;
  color: #fff;
  border: none;
  padding: 9px 24px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
#cookieAcceptBtn:hover {
  background: #6e8496;
}
@media print {
  #cookieConsentBanner {
    display: none !important;
  }
}

/* ═══════════════════════════ Boxed login message pills ═══════════════════════════ */
/* spec-auth §2.3 — 8% tint / 20% border / radius 8. Replaces the old flat
 * .ct-login-error text with a proper pill; success mirror for reset/verify. */
.ct-auth-error,
.ct-auth-success {
  text-align: center;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}
.ct-auth-error {
  color: #b23127;
  background: rgba(178, 49, 39, 0.08);
  border: 1px solid rgba(178, 49, 39, 0.2);
}
.ct-auth-success {
  color: #2f6b34;
  background: rgba(47, 107, 52, 0.08);
  border: 1px solid rgba(47, 107, 52, 0.2);
}
.ct-auth-error[hidden],
.ct-auth-success[hidden] {
  display: none;
}

/* ═══════════════════════════ Password-strength meter ═══════════════════════════ */
/* spec-auth §4.3 — a 4px track with a colour-coded fill + tier label, mirroring
 * the backend policy (≥12 chars, upper, lower, digit). */
.ct-pw-strength {
  margin: 4px 0 2px;
}
.ct-pw-strength-track {
  height: 4px;
  border-radius: 2px;
  background: #e4e9ef;
  overflow: hidden;
}
.ct-pw-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}
.ct-pw-strength-fill[data-tier="weak"] {
  background: #b23127;
}
.ct-pw-strength-fill[data-tier="fair"] {
  background: #b3760f;
}
.ct-pw-strength-fill[data-tier="strong"] {
  background: #2f6b34;
}
.ct-pw-strength-label {
  font-size: 0.75rem;
  margin-top: 3px;
  min-height: 1.1em;
  color: var(--text-muted, #3f5469);
}
.ct-pw-strength-label[data-tier="weak"] {
  color: #b23127;
}
.ct-pw-strength-label[data-tier="fair"] {
  color: #b3760f;
}
.ct-pw-strength-label[data-tier="strong"] {
  color: #2f6b34;
}

/* ═══════════════════════════ Signup consent block ═══════════════════════════ */
/* spec-auth §4.1 consent-section — GDPR + terms/privacy, both required. */
.ct-consent {
  background: rgba(82, 104, 120, 0.06);
  border: 1px solid var(--border, #cdd8e2);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 6px 0 2px;
  text-align: left;
}
.ct-consent-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #3f5469);
  margin: 0 0 10px;
}
.ct-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text, #0e1823);
  line-height: 1.45;
  cursor: pointer;
}
.ct-consent-row + .ct-consent-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #cdd8e2);
}
.ct-consent-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: #16293d;
  cursor: pointer;
}
.ct-consent-row a {
  color: #526878;
  font-weight: 600;
  text-decoration: underline;
}

/* ═══════════════════════════ Login card: language toggle + legal links ═══════════════════════════ */
/* The login card has no topbar, so the pre-auth language toggle sits in the
 * card's top-right corner. i18n.js wires any [data-lang-toggle]. */
.ct-login-card {
  position: relative;
}
.ct-login-langtoggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border, #cdd8e2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #16293d;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  z-index: 3;
}
.ct-login-langtoggle:hover {
  background: #fff;
  border-color: #526878;
}
.ct-login-legal {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted, #3f5469);
}
.ct-login-legal a {
  color: #526878;
  text-decoration: none;
}
.ct-login-legal a:hover {
  text-decoration: underline;
}
.ct-login-legal .ct-login-legal-sep {
  margin: 0 8px;
  opacity: 0.5;
}
