/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0f1e38;
  --blue:   #2563eb;
  --blue-d: #1d4ed8;
  --blue-l: #dbeafe;
  --accent: #3b82f6;
  --green:  #16a34a;
  --red:    #dc2626;
  --grey:   #64748b;
  --border: #e2e8f0;
  --bg:     #f8fafc;
  --white:  #ffffff;
  --text:   #0f172a;
  --text2:  #475569;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: var(--white); line-height: 1.6; font-size: 16px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Courier New', monospace; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: .875em; }
ul { list-style: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.25rem; border-radius: 8px; font-size: .9rem; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; transition: all .15s; text-decoration: none;
  font-family: inherit;
}
.btn-primary  { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-d); border-color: var(--blue-d); text-decoration: none; }
.btn-outline  { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-l); text-decoration: none; }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-outline-white:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--grey); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger   { background: #fee2e2; color: var(--red); border-color: #fca5a5; }
.btn-danger:hover { background: #fecaca; }
.btn-disabled { background: var(--border); color: var(--grey); cursor: not-allowed; }
.btn-lg  { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-sm  { padding: .3rem .75rem; font-size: .8rem; }
.btn-block { width: 100%; margin-top: .5rem; }

/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav { background: var(--navy); position: sticky; top: 0; z-index: 100; }
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.2rem; font-weight: 800; color: #fff; letter-spacing: -.02em;
}
.nav-brand:hover { text-decoration: none; }
.nav-logo { font-size: 1.4rem; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: rgba(255,255,255,.75); font-size: .9rem; font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash-wrap { padding: .5rem 2rem; background: #f8fafc; }
.flash { max-width: 1200px; margin: 0 auto .4rem; padding: .75rem 1.25rem; border-radius: 8px; font-size: .9rem; font-weight: 500; }
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%); color: #fff; padding: 6rem 2rem; }
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-block; background: rgba(59,130,246,.25); color: #93c5fd;
  border: 1px solid rgba(59,130,246,.4); border-radius: 100px;
  padding: .35rem 1rem; font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 1.5rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 1.25rem; }
.accent  { color: #60a5fa; }
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,.75); max-width: 640px; margin: 0 auto 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.hero-note { font-size: .85rem; color: rgba(255,255,255,.45); }

/* ── Sections ────────────────────────────────────────────────────────────── */
.section     { padding: 5rem 2rem; }
.section-alt { background: var(--bg); }
.container   { max-width: 1200px; margin: 0 auto; }
.container-narrow { max-width: 780px; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .75rem; }
.section-header p  { font-size: 1.05rem; color: var(--text2); }

/* ── Pain / value grid ───────────────────────────────────────────────────── */
.pain-grid { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; justify-content: center; }
.pain-card { flex: 1; min-width: 260px; max-width: 380px; }
.pain-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .6rem; }
.pain-card p  { color: var(--text2); font-size: .95rem; }
.pain-icon    { font-size: 2rem; margin-bottom: .75rem; }
.pain-arrow   { font-size: 2.5rem; color: var(--blue); flex: 0 0 auto; max-width: 60px; text-align: center; }
.pain-card-after { background: var(--white); border: 2px solid var(--blue-l); border-radius: var(--radius); padding: 1.5rem; }

/* ── Features grid ───────────────────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.feature-card  { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.feature-icon  { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p  { color: var(--text2); font-size: .9rem; margin-bottom: .75rem; }
.feature-card ul li { color: var(--text2); font-size: .875rem; padding: .2rem 0 .2rem 1.2rem; position: relative; }
.feature-card ul li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* ── Steps ───────────────────────────────────────────────────────────────── */
.steps { display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap; justify-content: center; }
.step  { flex: 1; min-width: 180px; max-width: 220px; text-align: center; padding: 0 1rem; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); color: #fff;
  font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; }
.step h4 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.step p  { font-size: .875rem; color: var(--text2); }
.step-connector { flex: 0 0 40px; height: 2px; background: var(--border); margin-top: 24px; }

/* ── Requirements table ──────────────────────────────────────────────────── */
.req-table { width: 100%; border-collapse: collapse; }
.req-table th, .req-table td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .95rem; }
.req-table th { width: 160px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.req-table tr:nth-child(even) { background: var(--bg); }
.req-table tr:last-child th, .req-table tr:last-child td { border-bottom: none; }

/* ── CTA section ─────────────────────────────────────────────────────────── */
.cta-section { background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%); color: #fff; }
.cta-inner   { text-align: center; }
.cta-inner h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .75rem; }
.cta-inner p  { color: rgba(255,255,255,.75); margin-bottom: 2rem; font-size: 1.05rem; }

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page { min-height: calc(100vh - 130px); display: flex; align-items: center; justify-content: center; padding: 3rem 1rem; background: var(--bg); }
.auth-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  padding: 2.5rem; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.auth-card-wide { max-width: 640px; }
.auth-logo  { font-size: 2.5rem; text-align: center; margin-bottom: 1rem; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; text-align: center; letter-spacing: -.03em; margin-bottom: .4rem; }
.auth-sub   { text-align: center; color: var(--text2); font-size: .9rem; margin-bottom: 1.75rem; }
.auth-form  { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { text-align: center; font-size: .875rem; color: var(--text2); margin-top: 1.25rem; }

/* ── Fields ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text); }
.field input, .field textarea, .field select {
  border: 1.5px solid var(--border); border-radius: 8px; padding: .6rem .875rem;
  font-size: .95rem; font-family: inherit; color: var(--text); outline: none;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.field textarea { resize: vertical; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row-end { align-items: flex-end; }
.required { color: var(--red); }
.hint { color: var(--grey); font-weight: 400; }
.checkbox-label { display: flex; align-items: center; gap: .4rem; font-size: .875rem; cursor: pointer; }

/* ── Inner pages ─────────────────────────────────────────────────────────── */
.inner-page { padding: 3rem 2rem; min-height: calc(100vh - 130px); }
.page-header { margin-bottom: 2.5rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .4rem; }
.page-header p  { color: var(--text2); }

/* ── Download page ───────────────────────────────────────────────────────── */
.download-card {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  background: var(--white); border: 2px solid var(--blue-l); border-radius: var(--radius);
  padding: 2rem; margin-bottom: 2.5rem; box-shadow: var(--shadow);
}
.download-icon { font-size: 3rem; }
.download-info { flex: 1; }
.download-info h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .25rem; }
.download-meta { color: var(--grey); font-size: .875rem; margin-bottom: .35rem; }
.download-desc { color: var(--text2); font-size: .9rem; }
.download-btn  { white-space: nowrap; }

.install-steps, .changelog { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.5rem; }
.install-steps h2, .changelog h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.install-steps ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .75rem; }
.install-steps li { font-size: .9rem; color: var(--text2); line-height: 1.6; }
.install-steps li strong { color: var(--text); }
.changelog ul li { font-size: .9rem; color: var(--text2); padding: .3rem 0 .3rem 1.2rem; position: relative; }
.changelog ul li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.download-support { font-size: .875rem; color: var(--grey); margin-top: .5rem; }

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-section { margin-bottom: 3rem; }
.admin-section h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.create-user-form { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { background: #f1f5f9; color: var(--text2); font-weight: 600; padding: .65rem 1rem; text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.row-inactive td { opacity: .55; }
.td-date    { white-space: nowrap; color: var(--grey); font-size: .8rem; }
.td-actions { white-space: nowrap; display: flex; gap: .35rem; flex-wrap: nowrap; }
.td-message { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.empty-state { color: var(--grey); font-size: .9rem; padding: 1rem 0; }
.muted { color: var(--grey); font-size: .8em; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; justify-content: center;
  padding: .15rem .6rem; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.badge-red   { background: #fee2e2; color: var(--red); }
.badge-green { background: #dcfce7; color: var(--green); }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-grey  { background: #f1f5f9; color: var(--grey); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer { background: var(--navy); color: rgba(255,255,255,.45); font-size: .8rem; padding: 1.25rem 2rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
  .steps { flex-direction: column; align-items: center; }
  .step-connector { width: 2px; height: 24px; margin: 0; }
  .pain-arrow { transform: rotate(90deg); }
  .download-card { flex-direction: column; text-align: center; }
  .td-actions { flex-wrap: wrap; }
  .field-row { flex-direction: column; }
}
