/* ═══════════════════════════════════════════
   REDANGLO ONBOARDING — Brand Stylesheet
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --red: #e31f24;
  --red-dark: #d72638;
  --red-light: rgba(227,31,36,0.07);
  --red-glow: rgba(227,31,36,0.15);
  --dark: #2c2c2c;
  --steel: #f6f6f6;
  --grey: #8b8b8b;
  --white: #ffffff;
  --green: #10b981;
  --green-light: rgba(16,185,129,0.06);
  --amber: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--steel);
  color: var(--dark);
  min-height: 100vh;
}
::selection { background: var(--red-light); color: var(--dark); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey); border-radius: 9px; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: var(--dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.3s;
}
.sidebar-brand {
  padding: 24px 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand img {
  height: 36px;
  width: auto;
}
.sidebar-brand .logo-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-brand h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.5px;
}
.sidebar-brand small {
  font-size: 10px;
  color: var(--grey);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-top: 1px;
}
.sidebar nav { flex: 1; padding: 16px 0; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--red);
  background: rgba(227,31,36,0.12);
  border-left-color: var(--red);
  font-weight: 600;
  text-decoration: none;
}
.sidebar nav a .icon { font-size: 16px; width: 22px; text-align: center; }

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  overflow-y: auto;
}
.page { padding: 40px 48px; max-width: 1200px; }

/* ── Typography ── */
.page-title {
  font-family: 'Instrument Serif', serif;
  font-size: 34px;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: 6px;
}
.page-subtitle {
  color: var(--grey);
  font-size: 14px;
  margin-bottom: 36px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--red);
  display: inline-block;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  font-family: 'Instrument Serif', serif;
}
.stat-card .label {
  font-size: 13px;
  color: var(--grey);
  margin-top: 4px;
  font-weight: 500;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* ── Table ── */
.table-wrap {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--steel);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-header h3 { font-size: 16px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--steel); }
th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grey);
}
td { padding: 16px 20px; font-size: 13px; }
tbody tr { border-bottom: 1px solid var(--steel); transition: background 0.15s; }
tbody tr:hover { background: var(--red-light); }

/* ── Buttons ── */
.btn {
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-red { background: var(--red); color: white; box-shadow: 0 4px 16px rgba(227,31,36,0.25); }
.btn-red:hover { background: var(--red-dark); }
.btn-dark { background: var(--dark); color: white; }
.btn-dark:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}
.btn-outline:hover { background: var(--red); color: white; }
.btn-sm { padding: 8px 20px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.3px;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border 0.2s;
  background: var(--white);
}
.form-input:focus { border-color: var(--red); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Progress Bar ── */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--steel);
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s;
}

/* ── Badge/Tag ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-red { background: var(--red-light); color: var(--red); }
.badge-green { background: #d1fae5; color: #065f46; }

/* ── Avatar ── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--red-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--red);
  font-size: 14px;
  flex-shrink: 0;
}
.avatar-lg {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  font-size: 22px;
  font-family: 'Instrument Serif', serif;
}

/* ── Checklist Item ── */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1.5px solid #eee;
  transition: all 0.2s;
}
.checklist-item.checked {
  background: var(--green-light);
  border-color: var(--green);
}
.checklist-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--green);
}
.checklist-item .label-text { font-size: 13.5px; }
.checklist-item.checked .label-text {
  font-weight: 600;
  color: #065f46;
  text-decoration: line-through;
}

/* ── Steps / Progress Tabs ── */
.steps-bar {
  display: flex;
  background: var(--white);
  border-radius: 14px;
  padding: 0 8px;
  box-shadow: var(--shadow);
  overflow: auto;
  margin-bottom: 32px;
}
.step-tab {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  border: none;
  background: transparent;
  cursor: pointer;
  min-width: 100px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.step-tab.active {
  background: var(--red-light);
  border-bottom-color: var(--red);
}
.step-tab .step-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #e5e5e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.step-tab.complete .step-icon { background: var(--green); color: white; }
.step-tab.current .step-icon { background: var(--red); color: white; }
.step-tab .step-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: block;
  color: var(--grey);
}
.step-tab.active .step-label { color: var(--red); }

/* ── Email Preview ── */
.email-preview {
  background: var(--steel);
  border-radius: 12px;
  padding: 28px;
  margin-top: 16px;
}
.email-preview-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
}
.email-body {
  background: var(--white);
  border-radius: 10px;
  padding: 24px;
  font-size: 13px;
  line-height: 1.8;
}

/* ── Offer Letter Preview ── */
.offer-header {
  background: var(--dark);
  color: var(--white);
  padding: 28px 40px;
}
.offer-header h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 1px;
}
.offer-header .accent-line {
  width: 50px; height: 3px;
  background: var(--red);
  margin-top: 8px;
}
.offer-body { padding: 32px 40px; line-height: 1.8; font-size: 13.5px; }
.offer-footer {
  background: var(--dark);
  color: var(--grey);
  padding: 16px 40px;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
}

/* ── Alert Box ── */
.alert-box {
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.alert-red {
  background: var(--red-light);
  border: 1.5px solid var(--red-glow);
}

/* ── Accordion ── */
.accordion-item {
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1.5px solid #e0e0e0;
  overflow: hidden;
  transition: all 0.2s;
}
.accordion-item.signed { border-color: var(--green); }
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  cursor: pointer;
  background: var(--white);
}
.accordion-item.signed .accordion-header { background: var(--green-light); }
.accordion-body {
  padding: 0 22px 22px;
  background: var(--steel);
  border-top: 1px solid #eee;
  display: none;
}
.accordion-body.open { display: block; padding-top: 16px; }
.dynamic-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.dynamic-field {
  padding: 5px 12px;
  background: var(--white);
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid #e5e5e5;
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
}
.login-card {
  width: 420px;
  background: var(--white);
  border-radius: 20px;
  padding: 40px 40px 48px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.login-card h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 8px;
}
.login-card .brand-bar {
  width: 40px; height: 4px;
  background: var(--red);
  margin: 0 auto 32px;
  border-radius: 2px;
}
.login-card img { display: block; margin: 0 auto; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--dark);
  color: white;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: slideUp 0.3s ease-out;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease-out both; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-brand h2, .sidebar-brand small, .sidebar nav a span { display: none; }
  .sidebar nav a { padding: 12px 18px; justify-content: center; }
  .main-content { margin-left: 60px; }
  .page { padding: 20px 16px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
