/* ============================================================
   SALARY SURVEY FORM — MAIN STYLESHEET
   Project : HR Consultancy — Annual Salary Survey
   Version : 1.0
   ============================================================

   TABLE OF CONTENTS
   1.  Design Tokens (CSS Variables)
   2.  Reset & Base
   3.  Top Navigation Bar
   4.  Progress Stepper
   5.  Page Layout
   6.  Section Cards (shared)
   7.  Section 1 — Position Info
   8.  Section 2 — Fixed Pay
   9.  Section 3 — Allowances
   10. Section 4 — Variable Pay
   11. Live Summary Panel
   12. Section Footer Buttons
   13. Success Screen
   14. Animations
   15. Responsive Breakpoints
   ============================================================ */

@font-face {
  font-family: 'Lato';
  src: url('../fonts/Lato-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Lato';
  src: url('../fonts/Lato-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Lato';
  src: url('../fonts/Lato-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Lato';
  src: url('../fonts/Lato-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
}


/* ─────────────────────────────────────────────────────────────
   1. DESIGN TOKENS
───────────────────────────────────────────────────────────── */
:root {
  /* Brand — Crimson / Red */
  --brand-50: #FEF2F2;
  --brand-100: #FEE2E2;
  --brand-200: #FECACA;
  --brand-300: #FCA5A5;
  --brand-400: #F87171;
  --brand-500: #AF2124;
  --brand-600: #991B1B;
  --brand-700: #7F1D1D;
  --brand-900: #450A0A;

  /* Accent — Rose */
  --accent-50: #FFF1F2;
  --accent-100: #FFE4E6;
  --accent-200: #FECDD3;
  --accent-400: #FB7185;
  --accent-500: #F43F5E;
  --accent-600: #E11D48;
  --accent-700: #BE123C;

  /* Success — Green */
  --success-50: #f0fdf4;
  --success-200: #bbf7d0;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  /* Warning — Amber */
  --warning-50: #fffbeb;
  --warning-200: #fde68a;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  /* Danger — Red */
  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;

  /* Neutrals — Slate */
  --color-navy: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --color-white: #ffffff;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 20px rgba(79, 70, 229, .12), 0 1px 4px rgba(15, 23, 42, .06);
  --shadow-glow: 0 0 0 3px rgba(99, 102, 241, .18);

  /* Typography */
  --font-body: 'Lato', sans-serif;
  --font-numbers: 'Lato', sans-serif;
  --font-title: 'Lato', sans-serif;
}


/* ─────────────────────────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--slate-50);
  color: var(--color-navy);
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────────
   3. TOP NAVIGATION BAR
───────────────────────────────────────────────────────────── */
.top-navbar {
  background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 50%, var(--accent-700) 100%);
  padding: 0 32px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(15, 23, 42, .2);
}

.top-navbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-to-list-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .65);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  transition: all .15s;
  border: 1px solid transparent;
}

.back-to-list-link:hover {
  color: white;
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .15);
}

.navbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, .18);
}

.site-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  margin: 0 5px;
  filter: brightness(0) invert(1);
}

.navbar-position-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.navbar-position-name {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.navbar-position-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
}

.save-draft-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font-body);
}

.save-draft-button:hover {
  background: rgba(255, 255, 255, .18);
  color: white;
}

.save-draft-button.saved {
  background: rgba(34, 197, 94, .2);
  border-color: rgba(34, 197, 94, .4);
  color: #86efac;
}


/* ─────────────────────────────────────────────────────────────
   4. PROGRESS STEPPER
───────────────────────────────────────────────────────────── */
.stepper-bar {
  background: var(--color-white);
  border-bottom: 1px solid var(--slate-200);
  padding: 0 32px;
  position: sticky;
  top: 54px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.stepper-steps-list {
  display: flex;
  align-items: stretch;
  max-width: 900px;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 14px 0;
  cursor: pointer;
  position: relative;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  flex: 1;
}

.stepper-step:first-child {
  padding-left: 0;
}

/* Connector line between steps */
.stepper-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 1px;
  background: var(--slate-200);
  z-index: 1;
}

.stepper-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--slate-200);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-400);
  transition: all .2s;
  flex-shrink: 0;
}

.stepper-step:not(.active):hover .stepper-step-circle {
  border-color: var(--brand-400);
  color: var(--brand-500);
}

.stepper-step.done .stepper-step-circle {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: white;
}

.stepper-step.active .stepper-step-circle {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 10px rgba(99, 102, 241, .35);
}

.stepper-step.active {
  border-bottom-color: var(--brand-500);
}

.stepper-step-number {
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1;
  margin-bottom: 2px;
}

.stepper-step-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  line-height: 1;
}

.stepper-step.active .stepper-step-name {
  color: var(--color-navy);
}

.stepper-step.done .stepper-step-number,
.stepper-step.done .stepper-step-name {
  color: var(--brand-600);
}


/* ─────────────────────────────────────────────────────────────
   5. PAGE LAYOUT
───────────────────────────────────────────────────────────── */
.survey-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 24px 32px 60px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}


/* ─────────────────────────────────────────────────────────────
   6. SECTION CARDS (shared)
───────────────────────────────────────────────────────────── */
.survey-section-card {
  background: var(--color-white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: none;
  animation: slide-up-fade-in .3s ease;
}

.survey-section-card.active {
  display: block;
}

@keyframes slide-up-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header-area {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--slate-100);
}

.section-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.badge-section-01 {
  background: var(--brand-50);
  color: var(--brand-700);
}

.badge-section-02 {
  background: var(--success-50);
  color: var(--success-700);
}

.badge-section-03 {
  background: var(--warning-50);
  color: var(--warning-600);
}

.badge-section-04 {
  background: var(--accent-50);
  color: var(--accent-700);
}

.section-heading {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.section-description {
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.5;
}


/* ─────────────────────────────────────────────────────────────
   7. SECTION 1 — POSITION INFO
───────────────────────────────────────────────────────────── */
.system-prefilled-box {
  margin: 20px 24px;
  padding: 18px;
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--accent-50) 100%);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.system-prefilled-box::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .08), transparent 70%);
}

.system-data-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand-600);
  margin-bottom: 14px;
}

.system-data-label i {
  font-size: 13px;
}

.system-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.system-field-label {
  font-size: 11px;
  color: var(--brand-600);
  font-weight: 600;
  margin-bottom: 3px;
  opacity: .7;
}

.system-field-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
}

.system-field-value.locked {
  color: var(--slate-400);
  font-style: italic;
  font-weight: 400;
}

.system-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  background: rgba(99, 102, 241, .1);
  color: var(--brand-600);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  margin-left: 6px;
}

/* User input area */
.user-inputs-area {
  padding: 0 24px 24px;
}

.user-inputs-area-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--slate-500);
  margin-bottom: 16px;
  margin-top: 20px;
}

.form-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field-wrapper.full {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label-arabic {
  font-size: 11px;
  color: var(--slate-400);
  font-weight: 400;
}

.field-required-mark {
  color: var(--danger-500);
  font-size: 12px;
  margin-left: 1px;
}

.field-hint-text {
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 2px;
}

/* Shared input / select styles */
.text-input,
.number-input {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-navy);
  outline: none;
  transition: all .15s;
  width: 100%;
}

.text-input:hover,
.number-input:hover {
  border-color: var(--slate-300);
}

.text-input:focus,
.number-input:focus {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-glow);
}

.text-input::placeholder,
.number-input::placeholder {
  color: var(--slate-300);
}

.text-input.has-error,
.number-input.has-error,
.dropdown-select.has-error {
  border-color: var(--danger-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.dropdown-select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--color-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-navy);
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: all .15s;
  width: 100%;
}

.dropdown-select:hover {
  border-color: var(--slate-300);
}

.dropdown-select:focus {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-glow);
}

.field-validation-error {
  font-size: 12px;
  color: var(--danger-500);
  display: none;
  align-items: center;
  gap: 4px;
}

.field-validation-error.visible {
  display: flex;
}

/* Tooltip */
.tooltip-trigger {
  position: relative;
  cursor: help;
}

.tooltip-trigger-icon {
  font-size: 12px;
  color: var(--brand-400);
  margin-left: 4px;
}

.tooltip-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-navy);
  color: white;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 7px;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  font-weight: 400;
}

.tooltip-trigger:hover .tooltip-popup {
  opacity: 1;
}

.tooltip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-navy);
}


/* ─────────────────────────────────────────────────────────────
   8. SECTION 2 — FIXED PAY
───────────────────────────────────────────────────────────── */
.fixed-pay-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.monthly-salary-field-wrapper {
  position: relative;
}

.currency-code-badge {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-600);
  pointer-events: none;
  background: var(--brand-50);
  padding: 3px 8px;
  border-radius: 6px;
}

.monthly-salary-big-input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 72px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-lg);
  font-family: var(--font-numbers);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-navy);
  outline: none;
  transition: all .2s;
  background: var(--color-white);
}

.monthly-salary-big-input:hover {
  border-color: var(--brand-300);
}

.monthly-salary-big-input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}

.monthly-salary-big-input::placeholder {
  color: var(--slate-300);
  font-size: 18px;
  font-weight: 400;
}

.monthly-salary-big-input.has-error {
  border-color: var(--danger-500);
}

.formula-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--slate-400);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 0;
}

.formula-divider::before,
.formula-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--slate-200);
}

.annual-result-box {
  background: linear-gradient(135deg, var(--brand-50), var(--accent-50));
  border: 1.5px solid var(--brand-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all .3s;
}

.annual-result-box.has-value {
  border-color: var(--brand-400);
  background: linear-gradient(135deg, var(--brand-100), var(--accent-100));
}

.annual-formula-text {
  font-size: 12px;
  color: var(--brand-600);
  font-weight: 500;
  opacity: .7;
}

.annual-calculated-value {
  font-family: var(--font-numbers);
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-700);
  transition: all .3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.annual-value-currency {
  font-size: 14px;
  font-weight: 600;
  opacity: .6;
}

.auto-calc-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(99, 102, 241, .12);
  color: var(--brand-600);
  letter-spacing: .04em;
}


/* ─────────────────────────────────────────────────────────────
   9. SECTION 3 — ALLOWANCES
───────────────────────────────────────────────────────────── */
.allowances-content {
  padding: 24px;
}

.allowance-activation-area {
  margin-bottom: 20px;
}

.allowance-chips-instruction {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
}

.allowance-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.allowance-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--slate-200);
  background: var(--color-white);
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}

.allowance-toggle-chip:hover {
  border-color: var(--warning-500);
  color: var(--warning-600);
  background: var(--warning-50);
}

.allowance-toggle-chip.selected {
  border-color: var(--warning-500);
  background: var(--warning-50);
  color: var(--warning-600);
  box-shadow: 0 2px 8px rgba(245, 158, 11, .2);
}

.chip-checkmark-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--slate-300);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
  flex-shrink: 0;
}

.allowance-toggle-chip.selected .chip-checkmark-circle {
  background: var(--warning-500);
  border-color: var(--warning-500);
}

.allowance-toggle-chip.selected .chip-checkmark-circle::after {
  content: '✓';
  font-size: 9px;
  color: white;
  font-weight: 700;
}

.allowance-input-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.allowance-field-card {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all .2s;
  opacity: .4;
  pointer-events: none;
}

.allowance-field-card.enabled {
  opacity: 1;
  pointer-events: auto;
  border-color: var(--slate-200);
}

.allowance-field-card.enabled:focus-within {
  border-color: var(--warning-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .12);
}

.allowance-field-card.has-value {
  border-color: var(--warning-600);
}

.allowance-field-card-top {
  padding: 9px 12px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.allowance-field-english-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
}

.allowance-field-arabic-name {
  font-size: 10px;
  color: var(--slate-400);
}

.allowance-number-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-navy);
  background: var(--color-white);
}

.allowance-number-input::placeholder {
  color: var(--slate-300);
}

.allowance-currency-unit {
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-400);
  border-left: 1px solid var(--slate-100);
  background: var(--slate-50);
  white-space: nowrap;
}

.allowances-calculated-totals {
  margin-top: 20px;
  border: 1.5px solid var(--warning-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.allowances-totals-header {
  padding: 12px 16px;
  background: var(--warning-50);
  border-bottom: 1px solid var(--warning-200);
  display: flex;
  align-items: center;
  gap: 8px;
}

.allowances-totals-header i {
  color: var(--warning-600);
  font-size: 14px;
}

.allowances-totals-header-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning-600);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.allowances-totals-grid {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.allowance-total-item-name {
  font-size: 11px;
  color: var(--slate-500);
  font-weight: 600;
  margin-bottom: 4px;
}

.allowance-total-item-amount {
  font-family: var(--font-numbers);
  font-size: 18px;
  font-weight: 800;
}

.allowance-total-item-amount.amber {
  color: var(--warning-600);
}

.allowance-total-item-amount.dark {
  color: var(--color-navy);
}


/* ─────────────────────────────────────────────────────────────
   10. SECTION 4 — VARIABLE PAY
───────────────────────────────────────────────────────────── */
.variable-pay-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.variable-component-card {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all .2s;
}

.variable-component-card.expanded {
  border-color: var(--accent-400);
  box-shadow: 0 4px 16px rgba(139, 92, 246, .1);
}

.variable-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(to right, var(--slate-50), var(--color-white));
  border-bottom: 1px solid transparent;
  transition: all .2s;
}

.variable-component-card.expanded .variable-card-header {
  background: linear-gradient(to right, var(--accent-50), var(--brand-50));
  border-bottom-color: var(--accent-200);
}

.variable-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.variable-component-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all .2s;
}

.variable-component-card.expanded .variable-component-icon {
  transform: scale(1.1);
}

.icon-theme-sales {
  background: var(--brand-50);
  color: var(--brand-600);
}

.icon-theme-bonus {
  background: var(--accent-50);
  color: var(--accent-600);
}

.icon-theme-profit {
  background: var(--success-50);
  color: var(--success-600);
}

.icon-theme-other {
  background: var(--warning-50);
  color: var(--warning-600);
}

.variable-component-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-navy);
}

.variable-component-subtitle {
  font-size: 11px;
  color: var(--slate-400);
  font-weight: 400;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--slate-200);
  cursor: pointer;
  transition: all .2s;
  position: relative;
  border: none;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: all .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.toggle-switch.active {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
}

.toggle-switch.active::after {
  left: calc(100% - 19px);
}

.variable-card-body {
  display: none;
  padding: 18px 16px;
  background: var(--color-white);
}

.variable-component-card.expanded .variable-card-body {
  display: block;
  animation: slide-up-fade-in .2s ease;
}

/* Frequency selector pills */
.payment-frequency-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--slate-50);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
}

.frequency-pill {
  flex: 1;
  padding: 7px 0;
  text-align: center;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  transition: all .18s;
}

.frequency-pill:hover {
  background: var(--color-white);
  color: var(--color-navy);
}

.frequency-pill.active {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .28);
}

.frequency-pill.active .frequency-arabic {
  color: rgba(255, 255, 255, .7);
}

.frequency-arabic {
  font-size: 10px;
  display: block;
  margin-top: 1px;
  color: var(--slate-400);
  font-weight: 400;
}

/* Amount inputs (actual + target) */
.amount-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.amount-input-group-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.amount-input-group-label i {
  font-size: 11px;
}

.amount-label-actual {
  color: var(--brand-700);
}

.amount-label-target {
  color: var(--accent-700);
}

.amount-label-profit {
  color: var(--success-700);
}

.amount-label-other {
  color: var(--warning-600);
}

.amount-input-with-currency {
  position: relative;
}

.amount-currency-symbol {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-400);
}

.amount-number-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 42px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-navy);
  outline: none;
  transition: all .15s;
  background: var(--color-white);
}

.amount-number-input.actual-value:focus {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-glow);
}

.amount-number-input.target-value {
  border-style: dashed;
  color: var(--accent-600);
}

.amount-number-input.target-value:focus {
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .15);
}

/* Variable totals summary */
.variable-auto-totals {
  border: 1.5px solid var(--accent-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 4px;
}

.variable-totals-header {
  padding: 12px 16px;
  background: var(--accent-50);
  border-bottom: 1px solid var(--accent-200);
  display: flex;
  align-items: center;
  gap: 8px;
}

.variable-totals-header i {
  color: var(--accent-600);
  font-size: 14px;
}

.variable-totals-header-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-600);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.variable-totals-values-grid {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.variable-total-label {
  font-size: 11px;
  color: var(--slate-500);
  font-weight: 600;
  margin-bottom: 4px;
}

.variable-total-amount {
  font-family: var(--font-numbers);
  font-size: 16px;
  font-weight: 800;
}

.variable-total-amount.violet {
  color: var(--accent-600);
}

.variable-total-amount.blue {
  color: var(--brand-700);
}

.variable-total-amount.dark {
  color: var(--color-navy);
}


/* ─────────────────────────────────────────────────────────────
   11. LIVE SUMMARY PANEL
───────────────────────────────────────────────────────────── */
.live-summary-panel {
  background: var(--color-white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(54px + 62px + 20px);
  overflow: hidden;
}

.summary-panel-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--brand-900), var(--accent-700));
  position: relative;
  overflow: hidden;
}

.summary-panel-header::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .06), transparent);
}

.summary-panel-title {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, .9);
  margin-bottom: 2px;
}

.summary-panel-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
}

.summary-panel-body {
  padding: 14px 18px;
}

.summary-data-group {
  margin-bottom: 14px;
}

.summary-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slate-400);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--slate-100);
}

.summary-line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.summary-line-label {
  font-size: 12px;
  color: var(--slate-600);
}

.summary-line-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
  font-variant-numeric: tabular-nums;
}

.summary-line-value.empty {
  color: var(--slate-300);
}

.summary-line-value.calculated {
  color: var(--brand-600);
}

.summary-panel-footer {
  padding: 14px 18px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
}

.summary-grand-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.summary-grand-total-row:last-child {
  margin-bottom: 0;
}

.summary-grand-total-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-600);
}

.summary-grand-total-value {
  font-family: var(--font-numbers);
  font-size: 16px;
  font-weight: 800;
  color: var(--color-navy);
}

.summary-grand-total-value.green {
  color: var(--success-600);
}

.summary-grand-total-value.violet {
  color: var(--accent-600);
}

.variable-percentage-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-50);
  color: var(--accent-600);
  margin-left: 6px;
}


/* ─────────────────────────────────────────────────────────────
   12. SECTION FOOTER BUTTONS
───────────────────────────────────────────────────────────── */
.section-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--slate-50);
}

.section-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-progress-text {
  font-size: 12px;
  color: var(--slate-400);
}

.btn-go-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  transition: all .15s;
}

.btn-go-back:hover {
  border-color: var(--slate-300);
  color: var(--color-navy);
  background: var(--slate-50);
}

.btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-600));
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.btn-continue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, .45);
}

.btn-continue:active {
  transform: translateY(0);
}

.btn-submit-survey {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--success-600), #059669);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(22, 163, 74, .35);
}

.btn-submit-survey:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, .45);
}


/* ─────────────────────────────────────────────────────────────
   13. SUCCESS SCREEN
───────────────────────────────────────────────────────────── */
.submission-success-screen {
  display: none;
  background: var(--color-white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  padding: 60px 40px;
}

.submission-success-screen.active {
  display: block;
  animation: slide-up-fade-in .4s ease;
}

.success-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success-50), var(--success-200));
  border: 2px solid var(--success-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}

.success-main-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  color: var(--color-navy);
  margin-bottom: 8px;
}

.success-support-text {
  font-size: 14px;
  color: var(--slate-500);
  max-width: 360px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.success-data-table {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  margin-bottom: 28px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.success-table-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--slate-500);
  margin-bottom: 12px;
}

.success-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--slate-100);
}

.success-data-row:last-child {
  border-bottom: none;
}

.success-data-row-label {
  font-size: 13px;
  color: var(--slate-600);
}

.success-data-row-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-navy);
}

.success-data-row-value.green {
  color: var(--success-600);
}

.success-buttons-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-return-to-list {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}

.btn-return-to-list:hover {
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.btn-enter-next-position {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-600));
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
  text-decoration: none;
}


/* ─────────────────────────────────────────────────────────────
   14. ANIMATIONS
───────────────────────────────────────────────────────────── */
@keyframes field-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-4px);
  }

  40%,
  80% {
    transform: translateX(4px);
  }
}

.shake {
  animation: field-shake .35s ease;
}



.form-login-parent {
    width: 60%;
    margin: 0 auto;
}


.form-login-grid {
    display: block;
}

/* ─────────────────────────────────────────────────────────────
   15. RESPONSIVE BREAKPOINTS
───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .survey-page-layout {
    grid-template-columns: 1fr;
  }

  .live-summary-panel {
    position: static;
    margin-bottom: 20px;
  }

  .form-login-parent {
    width: 100%;
  }
}

@media (max-width: 768px) {

  .survey-page-layout,
  .top-navbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .stepper-bar {
    padding: 0 16px;
  }

  .stepper-step-label {
    display: none;
  }

  .form-fields-grid,
  .allowance-input-fields-grid,
  .amount-inputs-grid {
    grid-template-columns: 1fr;
  }

  .system-fields-grid {
    grid-template-columns: 1fr 1fr;
  }

  .payment-frequency-row {
    flex-wrap: wrap;
  }
}



