/* Account pages (subscription service): sign-up, welcome, Mijn abonnement,
   messages. Served at /css/account.css; in dev shadow-cljs swaps it in place
   on save (dev/repl.clj). Colours and type follow gader-website
   (tailwind.config.js); keep them in step. */

@font-face { font-family: "Ubuntu"; src: url("/fonts/Ubuntu-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("/fonts/Ubuntu-Medium.ttf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("/fonts/Ubuntu-Bold.ttf"); font-weight: 700; font-display: swap; }

:root {
  --teal: #279989;
  --teal-light: #54aea2;
  --teal-lighter: #84c5bc;
  --teal-pale: #d1ebe6;
  --mint: #dff0ed;
  --teal-white: #e8f5f1;
  --teal-dark: #285752;
  --coral: #ffa089;
  --coral-light: #f9ac93;
  --coral-dark: #e87765;
  --ink: #293133;
  --muted: #5b6b6e;
  --line: #c9dcd8;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Ubuntu", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--teal-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }

.wrap { width: 100%; max-width: 40rem; margin: 0 auto; padding: 0 1rem; }

/* frame */
header.site { background: var(--teal); padding: 1.1rem 0; }
header.site .brand { display: block; height: 30px; line-height: 0; }
main.wrap { flex: 1; padding-top: 2rem; padding-bottom: 2rem; }
.card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 2.25rem;
  box-shadow: 0 1px 2px rgba(41, 49, 51, .06), 0 8px 24px rgba(40, 87, 82, .08);
}
footer.site { padding: 0 0 2rem; font-size: .875rem; color: var(--muted); text-align: center; }
footer.site a { color: var(--muted); }

/* type */
h1 { font-size: 1.75rem; font-weight: 500; line-height: 1.25; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; }
small { color: var(--muted); font-size: .875rem; }
strong { font-weight: 500; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9rem;
  background: var(--teal-white);
  padding: .15rem .4rem;
  border-radius: 4px;
  word-break: break-all;
}

/* buttons */
.btn {
  display: inline-block;
  margin-top: .5rem;
  padding: .75rem 1.5rem;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.3;
  min-height: 3rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn.alt { background: #fff; color: var(--teal-dark); border-color: var(--line); }
.btn.alt:hover { background: var(--teal-white); border-color: var(--teal-light); color: var(--teal-dark); }

/* form */
form { margin-top: 1rem; }
label { display: block; margin-top: 1rem; margin-bottom: .3rem; font-weight: 500; }
input[type=text], input[type=email] {
  width: 100%;
  height: 3rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: #fff;
}
input[type=text]:focus, input[type=email]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-pale);
}
input[readonly] { background: var(--teal-white); color: var(--muted); }
input[type=radio], input[type=checkbox] { accent-color: var(--teal); width: 1.05rem; height: 1.05rem; vertical-align: -2px; }
.row { display: flex; gap: 1rem; }
.row > div { flex: 1; }
.err { display: block; color: var(--coral-dark); font-weight: 400; font-size: .9rem; }
.check label { font-weight: 400; }
form .btn[type=submit] { margin-top: 1.5rem; }

/* notes */
.note {
  background: var(--mint);
  border-left: 4px solid var(--teal);
  padding: .8rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

@media (max-width: 480px) {
  .card { padding: 1.5rem 1.25rem; border-radius: 12px; }
  main.wrap { padding-top: 1rem; }
  h1 { font-size: 1.5rem; }
  .row { flex-direction: column; gap: 0; }
}

/* sign-up */
.social { display: flex; gap: .75rem; margin-top: .75rem; }
.divider.lead { margin-top: 1.25rem; }
.social .btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: 0; padding: .75rem 1rem; white-space: nowrap; }
.divider { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0 0; color: var(--muted); font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.hint { display: block; margin-top: .35rem; line-height: 1.45; }
.choices { display: flex; gap: .75rem; }
.choices label {
  flex: 1;
  display: flex; align-items: center; gap: .55rem;
  margin: 0;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 400;
  cursor: pointer;
}
.choices label:has(input:checked) { border-color: var(--teal); background: var(--teal-white); }
/* organisation details only for an organisation (shown anyway after an error on them) */
.org {
  margin-top: 1rem;
  padding: .25rem 1rem 1rem;
  border-radius: var(--radius);
  background: var(--teal-white);
}
form:has(input[name=kind][value=particulier]:checked) .org:not(:has(.err)) { display: none; }
.check { margin-top: 1.25rem; }
.check label { display: flex; gap: .55rem; align-items: flex-start; margin-top: .5rem; }
.check input { margin-top: .25rem; flex: none; }
.after { margin: 1.25rem 0 0; color: var(--muted); }
/* a field with an error */
label:has(.err) + input { border-color: var(--coral-dark); }
label:has(.err) + input:focus { box-shadow: 0 0 0 3px #fde3dc; }

@media (max-width: 480px) {
  .social { flex-direction: column; }
  form .btn[type=submit] { width: 100%; }
}

/* connect block (welcome, Mijn abonnement) */
h2 { font-size: 1.2rem; font-weight: 500; margin: 0 0 .75rem; }
.connect { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.connect .btn { margin-top: 0; }
.connect .hint { margin-top: 1rem; }
.url { margin: .4rem 0 1rem; }
.url code {
  display: block;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--teal-white);
  user-select: all;
}
.note.warn { background: #fff1ec; border-left-color: var(--coral); }

/* welcome */
.done {
  width: 52px; height: 52px; margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--teal-white);
  color: var(--teal);
}

/* Mijn abonnement */
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.logout { font-size: .95rem; white-space: nowrap; }
.facts { margin: .5rem 0 0; }
.facts > div { display: flex; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--teal-pale); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { width: 8rem; flex: none; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pill { display: inline-block; padding: .1rem .65rem; border-radius: 999px; font-size: .9rem; font-weight: 500; }
.pill.ok { background: var(--mint); color: var(--teal-dark); }
.pill.warn { background: #fde3dc; color: #a2402f; }
.pill.off, .pill.neutral { background: #eef1f1; color: var(--muted); }
.cancel { display: block; margin-top: .3rem; font-weight: 400; color: var(--muted); font-size: .9rem; }
.manage { margin-top: 1.25rem; }

@media (max-width: 480px) {
  .facts > div { flex-direction: column; gap: .1rem; }
  .facts dt { width: auto; font-size: .9rem; }
  .connect .btn { display: block; text-align: center; }
}
