/* WorldPosta Identity — shared base styles.
   Phase A: extracted from per-page duplication. All design tokens centralized here.
   Page-specific styles stay inline in each page's <style> block. */

:root {
  --brand: #117954;
  --brand-hover: #0e603f;
  --brand-tint: rgba(17, 121, 84, .1);
  --bg: #f5f7f5;
  --card: #fff;
  --ink: #111;
  --ink-soft: #374151;
  --muted: #6b7280;
  --mute-soft: #9ca3af;
  --border: #d1d5db;
  --ok-bg: #d1fae5;
  --ok-fg: #065f46;
  --err-bg: #fee2e2;
  --err-fg: #991b1b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
  width: 100%;
  max-width: 400px;
}

h1 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--brand);
  font-weight: 600;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 14px;
}

input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

button {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}

button:hover { background: var(--brand-hover); }
button:disabled { opacity: .6; cursor: not-allowed; }

.brand {
  text-align: center;
  margin-bottom: 20px;
  font-size: 11px;
  color: var(--mute-soft);
  letter-spacing: 1px;
}

.foot {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}

.foot a {
  color: var(--brand);
  text-decoration: none;
}

.foot a:hover { text-decoration: underline; }

.err {
  background: var(--err-bg);
  color: var(--err-fg);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.err.show { display: block; }

.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.ok.show { display: block; }

.hint {
  font-size: 11px;
  color: var(--mute-soft);
  margin-top: -10px;
  margin-bottom: 14px;
}

/* Mobile responsive — matches existing per-page block exactly */
@media (max-width: 480px) {
  body { padding: 12px !important; min-height: 100vh; align-items: stretch; }
  .card {
    max-width: none !important;
    border-radius: 8px;
    padding: 20px !important;
    margin-top: 8px;
  }
  h1 { font-size: 20px !important; }
  .brand, #brand { font-size: 10px !important; }
  input { font-size: 16px !important; }  /* prevent iOS zoom */
  button { padding: 13px !important; font-size: 15px !important; }
  .btn-row { flex-direction: column-reverse; }
  .btn-row form { width: 100%; flex: none !important; }
}

@supports (padding: max(0px)) {
  body { padding-top: max(20px, env(safe-area-inset-top)); }
}
