:root {
  --bg: #E8F5EF;
  --surface: #FFFFFF;
  --ink: #39404F;
  --ink-2: #5C6573;
  --ink-3: #9AA2B0;
  --line: #E3E8EF;
  --accent: #478D5D;
  --accent-soft: #E3F0E9;
  --danger: #C2412F;
  --shadow-md: 0 14px 48px rgba(57, 64, 79, 0.12);
  --radius: 16px;
  --serif: "Source Serif 4", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: linear-gradient(135deg, #E8F5EF 0%, #DEF0E7 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); }

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 34px 32px 28px;
  animation: cardIn .35s cubic-bezier(.2, .7, .3, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}
.auth-brand .logo-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6FB587);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}
.auth-brand .brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.auth-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  text-align: center;
}
.auth-sub {
  color: var(--ink-2);
  font-size: 14px;
  text-align: center;
  margin: 0 0 22px;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FBFDFC;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 18px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1.5px solid var(--ink-3);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  position: relative;
}
.consent input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.consent a { text-decoration: underline; text-underline-offset: 2px; }

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 16px;
  transition: background .15s ease, transform .08s ease;
}
.btn-primary:hover { background: #3A7A4D; }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { background: var(--line); color: var(--ink-3); cursor: not-allowed; }

.auth-error {
  display: none;
  background: #FBE9E6;
  border: 1px solid #F1C8C0;
  color: var(--danger);
  font-size: 13px;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.auth-error.show { display: block; }

.auth-foot {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 18px;
}
.auth-foot a { font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

.auth-back {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: none;
}
.auth-back:hover { color: var(--ink-2); }

/* ===== Legal placeholder pages ===== */
.legal-shell {
  display: block;
  align-items: initial;
  justify-content: initial;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 22px 64px;
}
.legal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 36px 38px;
}
.legal-card h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.legal-meta { color: var(--ink-3); font-size: 13px; margin-bottom: 22px; }
.legal-placeholder {
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  color: #2f6e51;
  font-size: 13.5px;
  margin-bottom: 24px;
}
.legal-card h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 22px 0 8px;
}
.legal-card p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 12px; }
.legal-card .todo {
  color: var(--ink-3);
  font-style: italic;
  font-size: 13.5px;
}
.legal-back {
  display: inline-block;
  margin-top: 18px;
  font-size: 13.5px;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px 24px; border-radius: 18px; }
  .legal-card { padding: 26px 22px; }
}
