/* base.css — tokens, resets, typography, layout primitives */

:root {
  --plum-900: #2b1330;
  --plum-800: #3d1c46;
  --plum-700: #55265f;
  --plum-600: #6d3178;
  --plum-500: #8a4498;
  --plum-100: #f3e9f6;
  --plum-50: #faf5fb;

  --navy-900: #101a34;
  --navy-800: #16224a;
  --navy-700: #1e2f63;
  --navy-600: #2a3f80;

  --ink: #1b1626;
  --ink-soft: #4a4256;
  --muted: #756d84;
  --line: #e6dfec;
  --line-soft: #efe9f3;
  --bg: #fbf9fc;
  --white: #ffffff;

  --ok: #1b8a5a;
  --ok-bg: #e7f6ee;
  --warn: #a5680a;
  --warn-bg: #fdf1de;
  --err: #b3261e;
  --err-bg: #fbe9e8;
  --info: #2a3f80;
  --info-bg: #eaeefb;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(43,19,48,0.06), 0 1px 1px rgba(43,19,48,0.04);
  --shadow-md: 0 8px 24px rgba(43,19,48,0.10);
  --shadow-lg: 0 20px 50px rgba(43,19,48,0.16);

  --container: 1180px;
  --gap: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--plum-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy-900); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
p { margin: 0 0 1em; color: var(--ink-soft); }
small { color: var(--muted); }
[hidden] { display: none !important; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.grid { display: grid; gap: var(--gap); }
.flex { display: flex; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; }
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--plum-700), var(--plum-600));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-secondary {
  background: var(--white);
  color: var(--plum-700);
  border-color: var(--plum-500);
}
.btn-ghost {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--line);
}
.btn-danger { background: var(--err); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.chip.active {
  background: var(--plum-100);
  border-color: var(--plum-500);
  color: var(--plum-800);
}
.chip .x { opacity: .6; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-plum { background: var(--plum-100); color: var(--plum-800); }

.tag-phase2 {
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.tag-phase3, .tag-phase4 {
  background: #eee;
  color: #777;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  text-transform: uppercase;
}

label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=search],
input[type=password], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--plum-500);
  box-shadow: 0 0 0 3px var(--plum-100);
}
.field { margin-bottom: 16px; }
.field-error { color: var(--err); font-size: 12.5px; margin-top: 4px; }
.field.has-error input, .field.has-error select { border-color: var(--err); }
.help-text { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
fieldset { border: none; padding: 0; margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .04em; }

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  background: var(--navy-900);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: toast-in .18s ease;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.skeleton {
  background: linear-gradient(90deg, #f0eaf3 25%, #f8f4fa 37%, #f0eaf3 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 720px) {
  h1 { font-size: 26px; }
  .section { padding: 32px 0; }
}
