/* ccToDo website
 *
 * Palette derived from the logo. The pure logo colours (#ff6828 orange,
 * #a9abae grey) don't have enough contrast for text on white, so they are
 * used for accents and decoration; text and buttons use darker shades.
 *   white on --orange-600   4.96:1   (buttons)
 *   --orange-700 on white   5.86:1   (links)
 *   --grey-600 on white     5.84:1   (muted text)
 *   --ink on white         12.19:1   (body text)
 * Light theme only: the logo's charcoal "to" disappears on dark backgrounds.
 */

:root {
  color-scheme: light;

  --orange: #ff6828;       /* logo orange: accents, focus rings, icons */
  --orange-600: #cc3d00;   /* button background */
  --orange-700: #b83700;   /* links, button hover */
  --orange-200: #ffc9b2;
  --orange-100: #ffe6db;
  --orange-50: #fff4f0;

  --grey: #a9abae;         /* logo grey: borders, decoration */
  --grey-600: #636569;     /* muted text */
  --grey-200: #dfe0e1;
  --grey-100: #eff0f0;
  --grey-50: #f7f7f8;

  --ink: #373535;          /* logo charcoal: body text */
  --ink-900: #1f1d1d;      /* headings */
  --white: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31, 29, 29, .06), 0 8px 24px rgba(31, 29, 29, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
}

main { flex: 1; }

h1, h2, h3 { color: var(--ink-900); line-height: 1.15; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }

a { color: var(--orange-700); text-underline-offset: 2px; }
a:hover { color: var(--ink-900); }

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

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

.muted { color: var(--grey-600); }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-100);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
}
.brand { display: inline-flex; flex-shrink: 0; }
.brand img { display: block; width: 150px; height: auto; }
@media (min-width: 720px) { .brand img { width: 180px; } }

.nav { display: flex; align-items: center; gap: 8px; }
.nav form { margin: 0; }
.nav-user {
  color: var(--grey-600);
  font-size: .9rem;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 560px) { .nav-user { display: none; } }
@media (max-width: 400px) {
  .brand img { width: 124px; }
  .nav { gap: 4px; }
  .nav .btn { padding: 0 12px; }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--orange-600); color: var(--white); }
.btn-primary:hover { background: var(--orange-700); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--grey-50); color: var(--ink-900); }
.btn-block { width: 100%; }

.btn-social {
  width: 100%;
  background: var(--white);
  color: var(--ink-900);
  border-color: var(--grey-200);
  font-weight: 500;
}
.btn-social:hover { background: var(--grey-50); border-color: var(--grey); color: var(--ink-900); }
.btn-social .icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(1000px 420px at 85% -10%, var(--orange-100), transparent 70%),
    linear-gradient(180deg, var(--orange-50), var(--white));
  padding: 40px 0 56px;
}
@media (min-width: 900px) { .hero { padding: 72px 0 88px; } }

.hero-inner {
  display: grid;
  gap: 32px;
  align-items: start;
}
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--orange-700);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -.02em; margin-bottom: 20px; }
.hero .accent { color: var(--orange-600); }
.lead { font-size: 1.15rem; color: var(--ink); max-width: 36em; }

.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 32px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .15em;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ── Cards & forms ──────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
@media (min-width: 480px) { .card { padding: 32px; } }
.card h1, .card h2 { font-size: 1.5rem; }
.card-sub { margin-bottom: 20px; }
.card-foot { margin: 20px 0 0; text-align: center; color: var(--grey-600); font-size: .95rem; }
.hero-card { border-top: 4px solid var(--orange); }

.social { display: grid; gap: 10px; }
.social form { margin: 0; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--grey-600);
  font-size: .85rem;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--grey-200); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .auth-card label { font-weight: 600; font-size: .9rem; color: var(--ink-900); }

input[type="email"], input[type="password"], input[type="text"], input[type="url"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--grey);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink-900);
  font: inherit;
}
input::placeholder { color: var(--grey-600); opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange-600);
  box-shadow: 0 0 0 3px var(--orange-100);
}
.has-error input { border-color: #b3261e; }

.error { color: #b3261e; font-size: .9rem; margin: 0; }
.form-error { padding: 10px 12px; background: #fdecea; border-radius: var(--radius-sm); }
.help { color: var(--grey-600); font-size: .85rem; margin: 0; }
.help ul { margin: 4px 0 0; padding-left: 18px; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.check input { width: 18px; height: 18px; accent-color: var(--orange-600); }

/* ── Auth pages (also styles allauth's generic element templates) ── */
.page-auth main { background: linear-gradient(180deg, var(--orange-50), var(--white) 60%); }
.auth-page { display: flex; justify-content: center; padding: 40px 16px 64px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card form:not(.social form) { display: grid; gap: 14px; }
.auth-card form p { margin: 0; display: grid; gap: 6px; }
.auth-card button[type="submit"]:not(.btn) {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--orange-600);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.auth-card button[type="submit"]:not(.btn):hover { background: var(--orange-700); }
.auth-card ul.errorlist { list-style: none; padding: 0; margin: 0; color: #b3261e; font-size: .9rem; }
.auth-card hr { border: 0; border-top: 1px solid var(--grey-200); margin: 20px 0; }

/* ── Messages ───────────────────────────────────────────── */
.messages { padding-top: 16px; }
.message {
  margin: 0 0 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--orange-50);
  border-left: 4px solid var(--orange);
  color: var(--ink-900);
}
.message-error { background: #fdecea; border-left-color: #b3261e; }

/* ── Features ───────────────────────────────────────────── */
.features { padding: 56px 0 72px; }
.feature-grid { display: grid; gap: 20px; }
@media (min-width: 760px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.feature {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--grey-50);
  border: 1px solid var(--grey-100);
}
.feature h3 { font-size: 1.1rem; margin: 16px 0 8px; }
.feature p { margin: 0; color: var(--grey-600); }
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--orange-100);
  color: var(--orange-700);
}
.feature-icon svg { width: 24px; height: 24px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: var(--grey-100); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--white); }
.footer-inner a:hover { color: var(--orange-200); }
.footer-small { margin-left: auto !important; color: var(--grey); font-size: .9rem; }

.footer-links { display: flex; gap: 16px; }
.fine-print { margin: 0; color: var(--grey-600); font-size: .82rem; text-align: center; }

/* ── Legal pages ────────────────────────────────────────── */
.legal { max-width: 760px; padding-top: 48px; padding-bottom: 72px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.6rem); letter-spacing: -.01em; }
.legal .updated { color: var(--grey-600); margin-bottom: 32px; }
.legal h2 {
  font-size: 1.3rem;
  margin: 40px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--grey-100);
  scroll-margin-top: 88px;
}
.legal h3 { font-size: 1.05rem; margin: 24px 0 8px; }
.legal ul { padding-left: 22px; margin: 0 0 1rem; }
.legal li { margin-bottom: 6px; }
.legal li::marker { color: var(--orange); }
.legal .summary {
  background: var(--orange-50);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 8px;
}
.legal .summary p:last-child { margin-bottom: 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: .95rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--grey-200); vertical-align: top; }
.legal th { color: var(--ink-900); background: var(--grey-50); }
.table-scroll { overflow-x: auto; }
.field-link { margin: -8px 0 0; text-align: right; font-size: .9rem; }
