/* Account pages (tasks 4.2, 4.3): account hub, password reset, account deletion.
   Tokens from docs/DESIGN.md; header and footer match the website (web/styles.css). Then
   /ecrin.css (task 7.0f): the keys, the ornate panels and their medallions, as in the app. */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Great Vibes";
  src: url("/fonts/GreatVibes-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Alegreya Sans";
  src: url("/fonts/AlegreyaSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Alegreya Sans";
  src: url("/fonts/AlegreyaSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0A0A12;
  --bg-elevated: #12121E;
  --bg-overlay: #1A1A2A;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #F2F0FA;
  --text-secondary: #A6A3BD;
  --right-hand: #5CE1FF;
  --left-hand: #B28DFF;
  --accent: #FFC46B;
  --good: #6BF2B0;
  --miss: #FF6B8A;
  --font-logo: "Great Vibes", "Fraunces", cursive;
  --font-title: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 24px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(43, 36, 84, 0.45), transparent 70%),
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(92, 225, 255, 0.10), transparent 70%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(178, 141, 255, 0.12), transparent 70%),
    var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--right-hand);
  text-underline-offset: 3px;
}

a:hover {
  color: #B8F1FF;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px 24px;
  padding: 16px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.2;
  color: var(--text-primary);
  text-decoration: none;
  text-shadow: 0 0 24px rgba(92, 225, 255, 0.2);
}

.brand:hover {
  color: var(--text-primary);
}

.brand img {
  width: 32px;
  height: 32px;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* « Plus » in the menu: gold, with the glint of the app's Plus badge (web/styles.css). */
.nav a.plus-link {
  padding-left: 30px;
  color: var(--accent);
  background: var(--glint, none) 12px 50% / 12px 12px no-repeat;
}

.nav a.plus-link:hover {
  color: #FFE2B0;
  background-color: rgba(255, 196, 107, 0.1);
}

.languages {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.languages a {
  min-width: 44px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

/* Touch targets of 44 px at least, without changing the pills' look. */
.nav a,
.languages a {
  position: relative;
}

.nav a::after,
.languages a::after {
  content: "";
  position: absolute;
  inset: -7px -2px;
}

.languages a[aria-current="true"] {
  background: var(--bg-overlay);
  color: var(--accent);
}

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px var(--gutter) 48px;
}

h1 {
  margin: 8px 0 4px;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(32px, 6vw, 44px);
  line-height: 1.15;
}

.hands-line {
  width: 120px;
  height: 2px;
  margin: 16px 0 24px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--left-hand), var(--right-hand));
  box-shadow: 0 0 12px rgba(92, 225, 255, 0.35);
}

.lead {
  margin: 0 0 32px;
  font-size: 18px;
  color: var(--text-secondary);
}

h2 {
  margin: 0 0 12px;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: 24px;
}

/* Cards: the app's lacquer with a fine gold line; the panels of a form are ornate panels with
   their medallion (.ecrin.ornate.medalled, ecrin.css). */
.card {
  margin: 0 0 20px;
  padding: 24px 28px;
  border: 1px solid rgba(255, 196, 107, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 160px),
    var(--lacquer, var(--bg-elevated));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card.ecrin {
  border: 0;
  padding: 32px 34px;
}

.card.ecrin.medalled {
  margin-top: 64px;
  padding-top: 56px;
}

.card.ecrin.medalled > h2 {
  text-align: center;
}

.card > :last-child {
  margin-bottom: 0;
}

.card p,
.card ol,
.card ul {
  margin: 0 0 12px;
  color: var(--text-secondary);
}

.card li {
  margin: 4px 0;
}

.card strong {
  color: var(--text-primary);
  font-weight: 500;
}

.path {
  display: inline-block;
  padding: 1px 10px;
  border: 1px solid rgba(255, 196, 107, 0.3);
  border-radius: 999px;
  background: rgba(255, 196, 107, 0.08);
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
}

form,
.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 196, 107, 0.22);
  border-radius: 12px;
  background: rgba(10, 10, 18, 0.85);
  color: var(--text-primary);
  font: inherit;
  font-weight: 400;
  transition: border-color 150ms, box-shadow 150ms;
}

input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 196, 107, 0.15);
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hint {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--miss);
  flex: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Buttons are Écrin keys (class "key", ecrin.css). While a form is sent, its key waits. */
.key:disabled {
  cursor: progress;
}

.message {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
}

.message.error {
  border: 1px solid rgba(255, 107, 138, 0.35);
  background: rgba(255, 107, 138, 0.08);
  color: #FFC2CF;
}

.message.success {
  border: 1px solid rgba(107, 242, 176, 0.35);
  background: rgba(107, 242, 176, 0.08);
  color: #C9FBE3;
}

[hidden] {
  display: none !important;
}

.footer {
  padding: 40px var(--gutter) 28px;
  border-top: 1px solid rgba(255, 196, 107, 0.14);
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer .brand {
  margin: 0 0 8px;
  font-size: 32px;
}

.footer p {
  margin: 0 0 8px;
}

.footer h2 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer li {
  margin: 0 0 8px;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 28px auto 0 !important;
  padding-top: 20px;
  border-top: 1px solid var(--stroke);
  font-size: 12px;
}

@media (max-width: 1000px) {
  .footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  .brand {
    font-size: 28px;
  }

  .nav .optional {
    display: none;
  }

  .topbar {
    column-gap: 12px;
  }

  .nav a {
    padding: 8px 9px;
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 20px;
  }

  .card.ecrin {
    padding: 26px 20px;
  }

  .card.ecrin.medalled {
    padding-top: 52px;
  }

  .lead {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .brand img {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  input[type="email"],
  input[type="password"] {
    transition: none;
  }
}
