/* IFKD Platform: design concept stylesheet
   Shared foundations (tokens) + component styles for every concept page.
   Concept only: in the app these tokens move into the Tailwind theme. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700;800&display=swap");

/* ---------- Tokens ---------- */
:root {
  /* Brand: plum (IFKD primary; sidebar, primary buttons, focus) */
  --brand-950: #3a0620;
  --brand-900: #520a2e;
  --brand-800: #6b0c3b;
  --brand-700: #7d0e43;
  --brand:     #8e1049;
  --brand-500: #a83a6c;
  --brand-300: #d99ab7;
  --brand-200: #ecc9d9;
  --brand-100: #f7e7ef;
  --brand-50:  #fcf4f8;

  /* Brand accents (from IFKD site): teal + amber */
  --teal:      #4cbab6;
  --teal-700:  #1d6e6a;
  --teal-100:  #e2f4f3;
  --amber:     #f9b233;
  --amber-800: #7a4c00;
  --amber-100: #fef2d9;

  /* Semantic (kept distinct from the plum brand) */
  --success:     #1f7a4d;
  --success-100: #e2f2e9;
  --warning:     #7a4c00;
  --warning-100: #fef2d9;
  --danger:      #c03221;
  --danger-100:  #fbe6e3;
  --info:        #1d6e6a;
  --info-100:    #e2f4f3;

  /* Neutrals (slightly warm to sit with plum) */
  --gray-0:   #ffffff;
  --gray-25:  #faf9fa;
  --gray-50:  #f4f2f4;
  --gray-100: #ebe8ec;
  --gray-200: #dcd7de;
  --gray-300: #c4bdc7;
  --gray-400: #9b939e;
  --gray-500: #776f7a;
  --gray-600: #5d5560;
  --gray-700: #443d47;
  --gray-800: #2d2730;
  --gray-900: #1c171e;

  /* Surfaces & text */
  --bg: var(--gray-25);
  --surface: var(--gray-0);
  --surface-muted: var(--gray-50);
  --border: var(--gray-100);
  --border-strong: var(--gray-200);
  --text: var(--gray-900);
  --text-muted: var(--gray-600);
  --text-subtle: var(--gray-500);

  /* Type */
  --font-heading: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape & depth */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(28 23 30 / 0.06);
  --shadow: 0 1px 3px rgb(28 23 30 / 0.08), 0 4px 12px rgb(28 23 30 / 0.05);
  --shadow-lg: 0 12px 40px rgb(28 23 30 / 0.18);
  --focus-ring: 0 0 0 3px rgb(142 16 73 / 0.28);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 .5em; color: var(--gray-900); }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.0625rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-800); }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Concept-page shell (docs pages only) ---------- */
.doc { max-width: 1120px; margin: 0 auto; padding: 32px 16px 96px; }
.doc-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.doc-eyebrow { font-family: var(--font-heading); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.doc-section { margin: 48px 0; }
.doc-section > h2 { margin-bottom: 4px; }
.doc-section > .lead { color: var(--text-muted); margin-bottom: 20px; max-width: 70ch; }
.specimen { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.specimen + .specimen { margin-top: 16px; }
.grid-2 > .specimen + .specimen, .grid-3 > .specimen + .specimen { margin-top: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.note { font-size: 13px; color: var(--text-muted); border-left: 3px solid var(--teal); padding: 4px 0 4px 12px; margin: 16px 0 0; }
.label-caption { font-size: 12px; color: var(--text-subtle); margin-top: 6px; }

.concept-nav {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 100;
  display: flex; gap: 2px; padding: 4px; max-width: calc(100vw - 32px); overflow-x: auto;
  background: rgb(28 23 30 / 0.88); backdrop-filter: blur(8px); border-radius: var(--radius-pill); box-shadow: var(--shadow-lg);
}
.concept-nav a { color: #fff; text-decoration: none; font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: var(--radius-pill); white-space: nowrap; opacity: .8; }
.concept-nav a:hover { opacity: 1; background: rgb(255 255 255 / 0.1); color: #fff; }
.concept-nav a[aria-current="page"] { background: var(--brand); opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--gray-800); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  font: 600 14px/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-border);
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--gray-50); color: var(--gray-900); }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-border: var(--brand); }
.btn-primary:hover { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.btn-primary:active { background: var(--brand-900); }
.btn-secondary { --btn-bg: var(--brand-50); --btn-fg: var(--brand-800); --btn-border: var(--brand-200); box-shadow: none; }
.btn-secondary:hover { background: var(--brand-100); color: var(--brand-900); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--gray-700); box-shadow: none; }
.btn-ghost:hover { background: var(--gray-50); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }
.btn-danger:hover { background: #a12a1b; color: #fff; }
.btn-accent { --btn-bg: var(--amber); --btn-fg: var(--gray-900); --btn-border: var(--amber); }
.btn-accent:hover { background: #eaa21f; color: var(--gray-900); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-group .btn.is-active { background: var(--brand-50); color: var(--brand-800); border-color: var(--brand-200); position: relative; z-index: 1; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 16px; }
.label { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.label .opt { font-weight: 400; color: var(--text-subtle); }
.hint { font-size: 13px; color: var(--text-muted); }
.error-text { font-size: 13px; color: var(--danger); display: flex; gap: 6px; align-items: flex-start; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px;
  font: 400 15px/1.4 var(--font-body); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23776f7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input::placeholder, .textarea::placeholder { color: var(--gray-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(192 50 33 / .2); }
.input:disabled, .input[readonly] { background: var(--surface-muted); color: var(--text-muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-left: 38px; }
.input-wrap > .icon { position: absolute; left: 12px; color: var(--gray-400); pointer-events: none; }
.input-wrap .input-action { position: absolute; right: 6px; }
.input-wrap.has-action .input { padding-right: 44px; }
.input-wrap.no-lead .input { padding-left: 12px; }
.locked { display: flex; align-items: center; gap: 8px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check + .check { margin-top: 10px; }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1.5px solid var(--gray-300); background: var(--surface); border-radius: 5px; display: grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.check input:focus-visible { box-shadow: var(--focus-ring); }
.check small { display: block; color: var(--text-muted); font-size: 13px; }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--gray-300); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }

.dropzone { border: 1.5px dashed var(--brand-300); background: var(--brand-50); border-radius: var(--radius-lg); padding: 24px; text-align: center; color: var(--gray-700); }
.dropzone .icon { width: 28px; height: 28px; color: var(--brand); margin-bottom: 6px; }
.dropzone strong { color: var(--brand-800); }

/* ---------- Status chips, badges, alerts ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--gray-50); color: var(--gray-700); border: 1px solid var(--gray-100); }
.chip .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.chip-success { background: var(--success-100); color: var(--success); border-color: #c4e5d2; }
.chip-warning { background: var(--warning-100); color: var(--warning); border-color: #f7dda4; }
.chip-danger  { background: var(--danger-100); color: var(--danger); border-color: #f4c7c0; }
.chip-info    { background: var(--info-100); color: var(--info); border-color: #bfe5e3; }
.chip-brand   { background: var(--brand-100); color: var(--brand-800); border-color: var(--brand-200); }

.badge { display: inline-grid; place-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--amber); color: var(--gray-900); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: var(--gray-50); color: var(--gray-700); }
.tag-urban { background: #efe7f9; color: #5a2d91; }
.tag-tech  { background: var(--teal-100); color: var(--teal-700); }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.alert .icon { margin-top: 2px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert-info    { background: var(--info-100); border-color: #bfe5e3; color: #164f4c; }
.alert-success { background: var(--success-100); border-color: #c4e5d2; color: #175c3a; }
.alert-warning { background: var(--warning-100); border-color: #f7dda4; color: #5e3b00; }
.alert-danger  { background: var(--danger-100); border-color: #f4c7c0; color: #8c2418; }

/* ---------- Cards, tabs, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 1rem; margin: 0; }
.card-body { padding: 20px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { appearance: none; background: none; border: 0; padding: 10px 14px; margin-bottom: -1px; font: 600 14px var(--font-body); color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tab:hover { color: var(--gray-900); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle); padding: 10px 14px; background: var(--gray-25); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table tbody tr:hover { background: var(--brand-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .primary-cell { font-weight: 600; color: var(--gray-900); }
.table .sub { display: block; font-size: 12.5px; color: var(--text-subtle); font-weight: 400; }

.progress { height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.progress.is-teal > span { background: var(--teal); }
.progress.is-amber > span { background: var(--amber); }

.avatar { display: inline-grid; place-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--teal-700); color: #fff; font: 600 13px var(--font-heading); flex: none; }
kbd { font: 600 11px var(--font-body); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--gray-600); box-shadow: 0 1px 0 var(--border-strong); }

/* Stepper (bulk import) */
.stepper { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; counter-reset: step; flex-wrap: wrap; }
.stepper li { flex: 1 1 140px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; color: var(--text-muted); counter-increment: step; position: relative; }
.stepper li::before { content: counter(step); display: grid; place-content: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--gray-300); font-weight: 700; font-size: 13px; background: var(--surface); flex: none; }
.stepper li.is-done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper li.is-current { color: var(--gray-900); font-weight: 600; }
.stepper li.is-current::before { border-color: var(--brand); color: var(--brand); box-shadow: var(--focus-ring); }

/* Wordmark placeholder (real IFKD logo to be supplied) */
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.wordmark-mark { width: 34px; height: 34px; display: grid; place-content: center; transform: rotate(45deg); border-radius: 7px; background: #fff; }
.wordmark-mark span { transform: rotate(-45deg); font: 800 13px var(--font-heading); color: var(--brand); letter-spacing: -.02em; }
.wordmark-text { font: 800 20px/1 var(--font-heading); letter-spacing: .02em; }
.wordmark-text small { display: block; font: 500 11px/1.4 var(--font-body); letter-spacing: .08em; text-transform: uppercase; opacity: .7; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
