@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Dancing+Script:wght@700&display=swap');

:root {
  --brand-red: #e94560;
  --brand-red-dark: #c73652;
  --brand-red-light: #ff6b87;
  --brand-navy: #1a1a2e;
  --brand-navy-mid: #16213e;
  --brand-navy-light: #0f3460;
  --bg-primary: #0d0d1a;
  --bg-secondary: #13132a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1f1f3a;
  --bg-input: #0d0d20;
  --border-color: rgba(255,255,255,.08);
  --border-active: rgba(233,69,96,.5);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,.65);
  --text-muted: rgba(255,255,255,.35);
  --status-pending: #f59e0b;
  --status-completed: #10b981;
  --status-expired: #6b7280;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0,0,0,.4);
  --shadow-glow: 0 0 32px rgba(233,69,96,.15);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--brand-red); border-radius: 3px; }

h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s ease; text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  color: white; box-shadow: 0 4px 16px rgba(233,69,96,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(233,69,96,.5); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: rgba(255,255,255,.08); color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: rgba(255,255,255,.12); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.06); color: var(--text-primary); }
.btn-success { background: linear-gradient(135deg,#10b981,#059669); color: white; }
.btn-danger  { background: linear-gradient(135deg,#ef4444,#dc2626); color: white; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.w-full { width: 100%; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card);
  transition: border-color .2s;
}
.card:hover { border-color: rgba(233,69,96,.2); }

/* ── Form ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.form-input,.form-select,.form-textarea {
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: 'Inter', sans-serif; font-size: 14px; padding: 11px 14px;
  transition: border-color .2s, box-shadow .2s; outline: none; width: 100%;
}
.form-input:focus,.form-select:focus,.form-textarea:focus {
  border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(233,69,96,.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select option { background: var(--bg-card); color: var(--text-primary); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pending   { background: rgba(245,158,11,.15); color: var(--status-pending);   border: 1px solid rgba(245,158,11,.3); }
.badge-completed { background: rgba(16,185,129,.15);  color: var(--status-completed); border: 1px solid rgba(16,185,129,.3); }
.badge-expired   { background: rgba(107,114,128,.15); color: var(--status-expired);  border: 1px solid rgba(107,114,128,.3); }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 18px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: slideIn .3s ease; max-width: 380px;
}
.toast-success { background: #065f46; border: 1px solid #10b981; color: #ecfdf5; }
.toast-error   { background: #7f1d1d; border: 1px solid #ef4444; color: #fff1f2; }
.toast-info    { background: #1e3a5f; border: 1px solid #3b82f6; color: #eff6ff; }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); padding: 32px; max-width: 500px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.6); animation: scaleIn .2s ease;
}
@keyframes fadeIn  { from { opacity: 0; }            to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Admin Layout ── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--bg-secondary); border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-logo { padding: 22px; border-bottom: 1px solid var(--border-color); }
.sidebar-logo h2 { font-size: 14px; color: var(--brand-red); }
.sidebar-logo p  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 20px;
  color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: all .15s; border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--text-primary); background: rgba(255,255,255,.04); }
.sidebar-link.active { color: var(--brand-red); background: rgba(233,69,96,.08); border-left-color: var(--brand-red); }
.main-content { margin-left: 240px; flex: 1; min-height: 100vh; }
.page-header {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border-color);
  padding: 20px 32px; display: flex; align-items: center; justify-content: space-between;
}
.page-header h1 { font-size: 1.35rem; }
.page-body { padding: 28px 32px; max-width: 1280px; }

/* ── Stats ── */
.stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px 22px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border-color); }
.table td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }

/* ── Stepper ── */
.stepper { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; transition: all .3s; }
.step.active .step-num  { background: var(--brand-red); color: white; box-shadow: 0 0 12px rgba(233,69,96,.5); }
.step.done .step-num    { background: var(--status-completed); color: white; }
.step.inactive .step-num { background: rgba(255,255,255,.1); color: var(--text-muted); }
.step.active  .step-label { color: var(--text-primary); }
.step.done    .step-label { color: var(--status-completed); }
.step.inactive .step-label { color: var(--text-muted); }
.step-line { flex: 1; height: 1px; background: var(--border-color); min-width: 24px; }

/* ── Form Sections ── */
.form-section { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); margin-bottom: 18px; overflow: hidden; }
.form-section-header { padding: 14px 22px; background: rgba(233,69,96,.06); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--brand-red); }
.form-section-body { padding: 22px; }

/* ── Checkboxes ── */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 10px; padding: 9px 13px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; font-size: 13px; }
.checkbox-item:hover { border-color: var(--brand-red); background: rgba(233,69,96,.05); }
.checkbox-item input[type="checkbox"] { accent-color: var(--brand-red); width: 15px; height: 15px; cursor: pointer; }

/* ── Radio Cards ── */
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-card { padding: 9px 15px; border: 1.5px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: all .15s; font-size: 13px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; user-select: none; }
.radio-card.selected { border-color: var(--brand-red); background: rgba(233,69,96,.1); color: var(--brand-red); }
.radio-card input { display: none; }

/* ── Signature Pad ── */
.sig-tabs { display: flex; gap: 4px; margin-bottom: 12px; background: rgba(255,255,255,.04); padding: 4px; border-radius: var(--radius-md); width: fit-content; }
.sig-tab { padding: 7px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border: none; background: transparent; transition: all .15s; font-family: 'Inter', sans-serif; }
.sig-tab.active { background: var(--brand-red); color: white; }
.sig-canvas-wrap { border: 2px dashed var(--border-color); border-radius: var(--radius-lg); overflow: hidden; background: white; position: relative; }
.sig-canvas-wrap canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.typed-sig { font-family: 'Dancing Script', cursive; font-size: 40px; color: #1a1a2e; text-align: center; padding: 20px; min-height: 100px; display: flex; align-items: center; justify-content: center; background: white; border-radius: var(--radius-lg); border: 2px dashed var(--border-color); }

/* ── Copy field ── */
.copy-field { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 7px 7px 7px 14px; }
.copy-field span { flex: 1; font-size: 13px; color: var(--brand-red-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 44px; margin-bottom: 14px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Spinner ── */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ── */
hr.divider { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; }

/* ── Detail fields ── */
.detail-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.04); align-items: start; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.detail-value { font-size: 14px; color: var(--text-primary); word-break: break-word; }

/* ── Public Form Hero ── */
.form-hero { background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%); border-radius: var(--radius-xl); padding: 28px 32px; margin-bottom: 24px; border: 1px solid rgba(233,69,96,.25); box-shadow: var(--shadow-glow); }

/* ── Alert ── */
.alert { padding: 14px 18px; border-radius: var(--radius-md); font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #fbbf24; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #34d399; }
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #f87171; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-2,.grid-3 { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .page-header { padding: 14px 16px; }
}

@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
  .card { border: 1px solid #ddd; box-shadow: none; background: white; }
  .page-header,.sidebar { display: none !important; }
  .main-content { margin-left: 0; }
  .page-body { padding: 0; }
}
