/* AIESEC Document Generator — handwritten styles (no build step). */

:root {
  --bg: #f3f7fc;
  --card: #ffffff;
  --fg: #1a1a1a;
  --muted: #737373;
  --muted-bg: #f5f5f5;
  --border: #e5e5e5;
  --primary: #04275c;
  --primary-hover: #0353ad;
  --ring: #0468d7;
  --accent: #e7f1fd;
  --accent-strong: #dcebfb;
  --accent-fg: #05397a;
  --success: #047857;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --danger: #be123c;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --radius: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.fg { color: var(--fg); }
.strong { font-weight: 500; }
.text-xs { font-size: 12px; line-height: 16px; }
.text-sm { font-size: 14px; line-height: 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0 { min-width: 0; }
.grow { flex: 1 1 auto; }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.leading { line-height: 24px; }
.max-prose { max-width: 42rem; }
.w-sm { width: 100%; max-width: 24rem; }
.w-md { width: 100%; max-width: 28rem; }
.stack > * + * { margin-top: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.inline-center { display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.h-md { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.h-lg { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.h-xl { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.icon { width: 16px; height: 16px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-xl { width: 44px; height: 44px; display: block; margin: 0 auto; }

/* ---------- layout ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 256px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--border);
  min-height: 100vh; display: flex; flex-direction: column; padding: 20px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; margin-bottom: 48px; }
.brand-name { font-weight: 600; line-height: 1; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.brand-mark-lg { width: 48px; height: 48px; border-radius: 16px; font-size: 18px; margin: 0 auto; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; border-radius: 8px; padding: 10px 12px;
  font-size: 14px; color: var(--muted);
}
.nav-item:hover { background: var(--muted-bg); }
.nav-item.is-active { background: var(--accent); color: var(--accent-fg); font-weight: 500; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 16px 8px 0; display: flex; align-items: center; gap: 12px; }
.main { flex: 1 1 auto; min-width: 0; }
.topbar {
  height: 80px; border-bottom: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: space-between; padding: 0 40px;
}
.topbar-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; }
.page { padding: 40px; }
.page-wide { max-width: 72rem; }
.page-narrow { max-width: 48rem; margin: 0 auto; padding: 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.center-block { min-height: 60vh; display: flex; align-items: center; justify-content: center; }

.avatar {
  width: 36px; height: 36px; border-radius: 999px; background: var(--accent-strong); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.avatar-soft { background: var(--accent); }
.tile {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
}
.tile .icon { width: 20px; height: 20px; }
.tile-strong { background: var(--accent-strong); color: var(--primary); }
.tile-lg { width: 56px; height: 56px; border-radius: 16px; }
.type-tile {
  width: 40px; height: 40px; border-radius: 8px; background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0;
}

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); overflow: hidden; }
.card-accent { border-color: var(--ring); }
.card-pad { padding: 32px; }
.card-pad-lg { padding: 40px; }
.card-header { padding: 24px 24px 0; }
.card-header:last-child { padding-bottom: 24px; }
.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-description { color: var(--muted); font-size: 14px; margin-top: 6px; }
.card-body { padding: 24px; }
.card-footer { border-top: 1px solid var(--border); padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.price { font-size: 24px; font-weight: 600; }
.empty { padding: 40px; text-align: center; border-top: 1px solid var(--border); margin-top: 24px; }
.rows { margin-top: 24px; border-top: 1px solid var(--border); }
.rows > * + * { border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; }
.row-clickable { cursor: pointer; list-style: none; }
.row-clickable::-webkit-details-marker { display: none; }
.row-clickable:hover { background: rgb(245 245 245 / 0.6); }
.submission[open] .chevron { transform: rotate(180deg); }
.details-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px;
  padding: 20px; background: rgb(245 245 245 / 0.5); font-size: 14px;
}
.details-item { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.actions, .button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.button-row { justify-content: center; gap: 12px; }

/* ---------- grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2.gap-lg { gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: end; }
.span-4 { grid-column: 1 / -1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px;
  border-radius: 8px; border: 1px solid transparent; font-size: 14px; font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: background-color .15s, border-color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: var(--card); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--muted-bg); }
.btn-block { width: 100%; }
.btn-lg { height: 44px; }
.icon-button {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; font-size: 20px;
}
.icon-button:hover:not(:disabled) { background: var(--muted-bg); color: var(--fg); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 32px; }
.back-link:hover { color: var(--fg); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }
.field legend { margin-bottom: 8px; }
.input {
  height: 44px; width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  padding: 0 12px; font-size: 14px; font-weight: 400;
}
.input:focus, .choice input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 1px; }
.input-readonly { display: flex; align-items: center; background: rgb(245 245 245 / 0.6); color: var(--muted); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block; height: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  font-size: 14px; font-weight: 400; background: var(--card);
}
.choice span small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.choice input:checked + span { border-color: var(--ring); background: var(--accent); }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.turnstile { display: flex; justify-content: center; }
.filters { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.filters .input { width: auto; }
.search { position: relative; flex: 1 1 240px; max-width: 320px; display: block; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.search .input { width: 100%; padding-left: 36px; }

/* ---------- badges & alerts ---------- */
.badge {
  display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge-secondary { background: var(--accent); color: var(--primary); border-color: transparent; }
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.alert { border-radius: 10px; padding: 12px 16px; font-size: 14px; border: 1px solid; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

/* ---------- contract templates ---------- */
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; }
.input-file { width: auto; max-width: 100%; height: auto; padding: 8px 12px; }
.history { border-top: 1px solid var(--border); }
.history[open] .chevron { transform: rotate(180deg); }
.history .row-clickable { color: var(--muted); }
.rows-flush { margin-top: 0; }

/* ---------- small screens ---------- */
@media (max-width: 767px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; min-height: 0; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .brand { margin-bottom: 12px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-footer { margin-top: 12px; padding-top: 12px; }
  .topbar { padding: 0 16px; height: 72px; }
  .topbar .avatar { display: none; }
  .page, .page-narrow { padding: 24px 16px; }
  .card-pad, .card-pad-lg { padding: 24px; }
  .grid-2, .grid-4, .details-grid { grid-template-columns: 1fr; }
  .h-xl { font-size: 26px; line-height: 32px; }
  .search { max-width: none; }
  .filters .input { flex: 1 1 140px; }
}
