/* ============================================
   ICS Professional Development Evaluation Form
   Design System & Styles
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* ICS Brand Colors */
  --ics-navy: #1B3A5C;
  --ics-navy-dark: #122840;
  --ics-navy-light: #2A5580;
  --ics-blue: #2E6DA4;
  --ics-blue-light: #4A90D9;
  --ics-gold: #D4A843;
  --ics-gold-light: #E8C96A;

  /* Neutral Palette */
  --white: #FFFFFF;
  --gray-50: #F8F9FB;
  --gray-100: #F1F3F6;
  --gray-200: #E2E6EB;
  --gray-300: #CDD3DB;
  --gray-400: #A0AAB8;
  --gray-500: #6B7A8D;
  --gray-600: #4A5568;
  --gray-700: #333F4F;
  --gray-800: #1E2A3A;

  /* Semantic Colors */
  --color-primary: var(--ics-navy);
  --color-primary-hover: var(--ics-navy-light);
  --color-accent: var(--ics-gold);
  --color-accent-hover: var(--ics-gold-light);
  --color-success: #16A34A;
  --color-error: #DC2626;
  --color-error-bg: #FEF2F2;
  --color-warning: #F59E0B;

  /* Typography */
  --font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.25rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 3rem;

  /* Layout */
  --form-max-width: 780px;
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(27, 58, 92, 0.06), 0 1px 2px rgba(27, 58, 92, 0.04);
  --shadow-md: 0 4px 12px rgba(27, 58, 92, 0.08), 0 2px 4px rgba(27, 58, 92, 0.04);
  --shadow-lg: 0 10px 30px rgba(27, 58, 92, 0.12), 0 4px 8px rgba(27, 58, 92, 0.06);
  --shadow-xl: 0 20px 50px rgba(27, 58, 92, 0.15), 0 8px 16px rgba(27, 58, 92, 0.08);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--gray-700);
  background: linear-gradient(135deg, #EEF2F7 0%, #E8ECF4 50%, #F0F3F8 100%);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---------- Form Wrapper ---------- */
.form-wrapper {
  max-width: var(--form-max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

/* ---------- Header ---------- */
.form-header {
  background: linear-gradient(135deg, var(--ics-navy) 0%, var(--ics-navy-dark) 40%, var(--ics-navy-light) 100%);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.header-accent {
  height: 5px;
  background: linear-gradient(90deg, var(--ics-gold), var(--ics-gold-light), var(--ics-gold));
}

.header-content {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-2xl) var(--space-2xl) var(--space-3xl);
}

.logo {
  width: 90px;
  height: 90px;
  border-radius: var(--border-radius-md);
  object-fit: contain;
  background: white;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.header-text h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-text h2 {
  font-size: var(--font-size-lg);
  font-weight: 300;
  color: var(--ics-gold-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: var(--space-xs);
}

.header-decoration {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
}

.header-decoration svg {
  width: 100%;
  height: 40px;
}

/* Subtle pattern overlay */
.form-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h2V0h2v20h2V0h2v20h2V0h2v20h2V0h2v20.5z' fill='%23ffffff' fill-opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ---------- Progress Bar ---------- */
.progress-container {
  background: var(--white);
  padding: var(--space-lg) var(--space-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ics-blue), var(--ics-gold));
  border-radius: 100px;
  transition: width var(--transition-slow);
}

.progress-text {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

/* ---------- Form Sections ---------- */
.form-section {
  background: var(--white);
  padding: var(--space-2xl);
  border-left: 1px solid var(--gray-200);
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-100);
  position: relative;
  animation: fadeInUp 0.5s ease both;
}

.form-section:last-of-type {
  border-bottom: 1px solid var(--gray-200);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.1s; }
.form-section:nth-child(3) { animation-delay: 0.15s; }
.form-section:nth-child(4) { animation-delay: 0.2s; }
.form-section:nth-child(5) { animation-delay: 0.25s; }
.form-section:nth-child(6) { animation-delay: 0.3s; }

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--gray-100);
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  background: linear-gradient(135deg, var(--ics-navy), var(--ics-navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg {
  width: 20px;
  height: 20px;
  color: var(--white);
}

.section-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--ics-navy);
  letter-spacing: -0.01em;
}

/* ---------- Form Groups ---------- */
.form-group {
  margin-bottom: var(--space-xl);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-sm);
}

.field-description {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  margin-bottom: var(--space-md);
  margin-top: -2px;
  line-height: 1.5;
}

.required {
  color: var(--color-error);
  font-weight: 700;
}

.optional-badge {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: var(--space-sm);
  vertical-align: middle;
}

/* ---------- Form Row (side-by-side) ---------- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Inputs & Textareas ---------- */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--gray-800);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  outline: none;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="url"]:hover,
textarea:hover {
  border-color: var(--gray-300);
  background: var(--white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
textarea:focus {
  border-color: var(--ics-blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Date input special styling */
input[type="date"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ---------- Select Dropdown ---------- */
.select-wrapper {
  position: relative;
}

select {
  width: 100%;
  padding: 12px 44px 12px 16px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--gray-800);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

select:hover {
  border-color: var(--gray-300);
  background: var(--white);
}

select:focus {
  border-color: var(--ics-blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.12);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gray-400);
}

.select-arrow svg {
  width: 18px;
  height: 18px;
}

/* ---------- Scale Rating ---------- */
.scale-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.scale-label-text {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 55px;
  text-align: center;
}

.scale-options {
  display: flex;
  gap: var(--space-md);
  flex: 1;
  justify-content: center;
}

.scale-option {
  position: relative;
  cursor: pointer;
}

.scale-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.scale-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-400);
  background: var(--gray-50);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.scale-option:hover .scale-circle {
  border-color: var(--ics-blue-light);
  color: var(--ics-blue);
  background: rgba(46, 109, 164, 0.06);
  transform: scale(1.08);
}

.scale-option input:checked ~ .scale-circle {
  background: linear-gradient(135deg, var(--ics-navy), var(--ics-blue));
  border-color: var(--ics-navy);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(27, 58, 92, 0.3);
  transform: scale(1.1);
}

/* ---------- Radio Buttons ---------- */
.radio-group {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  padding: var(--space-md) var(--space-lg);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  flex: 1;
  justify-content: center;
}

.radio-option:hover {
  border-color: var(--ics-blue-light);
  background: rgba(46, 109, 164, 0.04);
}

.radio-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.radio-option input:checked ~ .radio-custom {
  border-color: var(--ics-navy);
  border-width: 2px;
}

.radio-option input:checked ~ .radio-custom::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border-radius: 50%;
  background: var(--ics-navy);
}

.radio-option:has(input:checked) {
  border-color: var(--ics-blue);
  background: rgba(46, 109, 164, 0.06);
}

.radio-label {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--gray-700);
}

/* ---------- Currency Input ---------- */
.currency-input {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 16px;
  font-weight: 600;
  color: var(--gray-500);
  font-size: var(--font-size-base);
}

.currency-input input {
  padding-left: 40px;
}

/* ---------- Error States ---------- */
.error-message {
  display: none;
  font-size: var(--font-size-xs);
  color: var(--color-error);
  margin-top: var(--space-sm);
  align-items: center;
  gap: var(--space-xs);
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: var(--color-error);
  background: var(--color-error-bg);
}

.form-group.has-error input:focus,
.form-group.has-error textarea:focus,
.form-group.has-error select:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-group.has-error .error-message {
  display: flex;
}

.form-group.has-error .scale-circle {
  border-color: rgba(220, 38, 38, 0.3);
}

.form-group.has-error .radio-option {
  border-color: rgba(220, 38, 38, 0.3);
}

/* ---------- Form Footer ---------- */
.form-footer {
  background: var(--white);
  padding: var(--space-2xl);
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.email-notice {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--gray-50);
  border-radius: var(--border-radius-sm);
}

.notice-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--gray-400);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-lg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--ics-navy), var(--ics-navy-light));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(27, 58, 92, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--ics-navy-light), var(--ics-blue));
  box-shadow: 0 6px 20px rgba(27, 58, 92, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(27, 58, 92, 0.2);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-700);
}

/* ---------- Success Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(27, 58, 92, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--space-3xl);
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl);
}

.success-icon {
  background: linear-gradient(135deg, #16A34A, #22C55E);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.3);
}

.success-icon svg {
  width: 36px;
  height: 36px;
  color: var(--white);
}

.modal h3 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--ics-navy);
  margin-bottom: var(--space-md);
}

.modal p {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

.modal .btn {
  width: 100%;
  justify-content: center;
}

/* ---------- Page Footer ---------- */
.page-footer {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.page-footer p {
  font-size: var(--font-size-xs);
  color: var(--gray-400);
}

/* ---------- Reimbursement Animated Reveal ---------- */
.reimbursement-amount {
  overflow: hidden;
  transition: all var(--transition-base);
}

.reimbursement-amount.slide-in {
  animation: slideDown 0.35s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
    margin-bottom: var(--space-xl);
    padding-top: var(--space-sm);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .form-wrapper {
    padding: var(--space-lg) var(--space-sm);
  }

  .header-content {
    flex-direction: column;
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-2xl);
  }

  .logo {
    width: 72px;
    height: 72px;
  }

  .header-text h1 {
    font-size: var(--font-size-xl);
  }

  .header-text h2 {
    font-size: var(--font-size-sm);
  }

  .form-section {
    padding: var(--space-xl) var(--space-lg);
  }

  .scale-group {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .scale-label-text {
    text-align: center;
  }

  .scale-options {
    justify-content: space-between;
  }

  .scale-circle {
    width: 42px;
    height: 42px;
  }

  .radio-group {
    flex-direction: column;
    gap: var(--space-md);
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .progress-container {
    padding: var(--space-md) var(--space-lg);
  }
}

/* ---------- Focus Visible (Accessibility) ---------- */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ics-blue);
  outline-offset: 2px;
}

.scale-option input:focus-visible ~ .scale-circle {
  outline: 2px solid var(--ics-blue);
  outline-offset: 2px;
}

.radio-option:has(input:focus-visible) {
  outline: 2px solid var(--ics-blue);
  outline-offset: 2px;
}

/* ---------- Smooth Interactions ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
