/* SmartLedger's start page. One stylesheet, no external fonts: the CSP allows only 'self'. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1c2421;
  --muted: #56615c;
  --accent: #1f5f4a;
  --accent-soft: #e3efe8;
  --border: #dcd8cf;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121715;
    --surface: #1a211e;
    --text: #e6ece9;
    --muted: #a2afa9;
    --accent: #7fcfa8;
    --accent-soft: #1f2e27;
    --border: #2c3632;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

main {
  flex: 1;
  width: 100%;
  max-width: 38rem;
  margin: 0 auto;
  padding: 4rem 1rem 2rem;
}

header { margin-bottom: 2rem; }

.mark { display: block; margin-bottom: 1.25rem; }

h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.15rem;
}

.lede {
  margin: 0.5rem 0 0;
  font-size: 1.2rem;
  color: var(--muted);
}

.status {
  margin: 1.75rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin-bottom: 0.75rem;
  padding: 1rem 1.1rem 1rem 3.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.6rem;
  text-align: center;
}

a { color: var(--accent); }

code {
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace;
}

footer {
  width: 100%;
  max-width: 38rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

footer p { margin: 0; }

/* Forms and buttons for the sign-in, invite and consent pages (WCAG 2.2 AA: 44 px targets, visible focus). */
:root {
  --warn-bg: #fff3d6;
  --warn-border: #b7791f;
  --btn-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --warn-bg: #3a2f12;
    --warn-border: #e0a640;
    --btn-text: #0c120f;
  }
}

[hidden] { display: none !important; }

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

form { margin-top: 1.5rem; }

fieldset {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

legend {
  padding: 0 0.4rem;
  font-weight: 600;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
}

.choice input {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  accent-color: var(--accent);
}

.hint {
  margin: 0 0 0.75rem 2.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.warn {
  margin: 1rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--warn-border);
  border-radius: 6px;
  background: var(--warn-bg);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0.65rem 1.4rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--btn-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* The two live regions (#status polite, #error alert) stay rendered, so a screen reader hears the
   text when it appears: while empty they are hidden visually, not with display:none (WCAG 4.1.3). */
#status:empty,
#error:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

#status,
#error {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
}

#error {
  border-left-color: var(--warn-border);
  background: var(--warn-bg);
}

.hint-block { color: var(--muted); }
