/* WSC Funding Application – Color scheme aligned with fund.weststreetcapital.co.za */
:root {
  /* Primary accent (growth green – matches fund site) */
  --primary: #c6d936;
  --primary-dark: #9eb82b;
  --accent: #9eb82b;
  --accent-light: #d4e85c;
  --trust: #9eb82b;
  /* Neutrals from fund site theme */
  --gray-50: #F6F6F8;
  --gray-100: #F6F6F8;
  --gray-200: #eaeaea;
  --gray-300: #e0e0e0;
  --gray-400: #94a3b8;
  --gray-500: #797979;
  --gray-600: #5a5a5a;
  --gray-700: #252525;
  --gray-900: #252525;
  --drk-txt: #000000;
  --success: #059669;
  --success-bg: #d1fae5;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: 0.2s ease;
  /* Fund site dark accent (header top bar) */
  --navy: #00152f;
  --sec-bg: #262420;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--gray-100);
  min-height: 100vh;
}

/* Site header – logo left, nav right (fund site: light header) */
.site-header {
  background: var(--gray-50);
  width: 100%;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--gray-900);
}

.site-logo-img {
  height: 70px;
  width: auto;
  display: block;
  object-fit: contain;
}

.site-cta-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--primary);
  color: #252525;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.site-cta-home-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.site-cta-home:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .site-header-inner {
    padding: 0.6rem 1rem;
  }

  .site-logo-img {
    height: 60px;
  }

  .site-cta-home {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 2rem;
  overflow-x: hidden;
}

/* Brand header */
.brand {
  width: 100%;
  max-width: 720px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.brand-inner {
  padding: 1rem 0;
}

.brand-logo {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

/* Ensure text on primary backgrounds is readable */
.brand-tagline {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Main content */
.main {
  width: 100%;
  max-width: 720px;
  flex: 1;
}

/* Progress tracker */
.progress-tracker {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
}

.progress-step {
  flex: 1;
  min-width: 4.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray-400);
  transition: color var(--transition);
  flex-shrink: 0;
}

.progress-step.active {
  color: var(--primary);
  font-weight: 600;
}

.progress-step.done {
  color: var(--accent);
}

.progress-step .step-num {
  display: block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  margin: 0 auto 0.35rem;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}

.progress-step.active .step-num {
  background: var(--primary);
  color: var(--gray-900);
}

.progress-step.done .step-num {
  background: var(--primary-dark);
  color: white;
}

.step-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 3px;
  width: 0%;
  transition: width 0.35s ease;
}

.progress-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Form card */
.form-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.form-step {
  display: none;
  animation: stepIn 0.3s ease;
}

.form-step.active {
  display: block;
}

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

.step-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.step-intro {
  margin: 0 0 1.5rem;
  color: var(--gray-600);
  font-size: 0.95rem;
}

.subsection {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--gray-200);
}

/* Fields */
.field {
  margin-bottom: 0.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.req {
  color: var(--error);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(198, 217, 54, 0.25);
}

input.error,
select.error,
textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
}

.radio-option input {
  width: auto;
  accent-color: var(--primary-dark);
}

.field-error {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--error);
  min-height: 1.2em;
}

.row-2,
.row-3 {
  display: grid;
  gap: 1rem;
}

.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }

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

/* Mobile responsive: steps and vertical scroll */
@media (max-width: 768px) {
  .app {
    padding: 0.75rem 0.75rem 1rem;
    height: 100vh;
    height: 100dvh;
  }

  .brand {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
  }

  .brand-logo {
    font-size: 1.4rem;
  }

  .main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .progress-tracker {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
  }

  .progress-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .progress-steps::-webkit-scrollbar {
    display: none;
  }

  .progress-step {
    flex: 0 0 auto;
    min-width: 5.5rem;
    font-size: 0.65rem;
  }

  .progress-step .step-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .form-card {
    flex: 1;
    min-height: 0;
    padding: 1rem 1rem 1.25rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .form-card .form-step.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
  }

  .step-title {
    font-size: 1.15rem;
  }

  .step-intro {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .form-actions {
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1rem;
  }

  .form-actions .btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .progress-step .step-name {
    font-size: 0.6rem;
  }

  .progress-step .step-num {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
    line-height: 1.5rem;
  }
}

/* Prescreening message */
.prescreen-message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.prescreen-message.success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.prescreen-message.success::before {
  content: '✓';
  font-size: 1.25rem;
  color: var(--success);
}

.prescreen-message.error {
  background: var(--error-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.prescreen-message.error::before {
  content: '✕';
  font-size: 1.25rem;
  color: var(--error);
}

/* File uploads */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
}

.file-field .file-desc {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 400;
}

.file-field input[type="file"] {
  padding: 0.4rem 0;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  font-size: 0.9rem;
}

.consent-field .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
}

.consent-field input[type="checkbox"] {
  width: auto;
  margin-top: 0.3rem;
  accent-color: var(--primary-dark);
}

/* Review summary */
.review-summary {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 0.95rem;
}

.review-summary h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-summary .review-section {
  margin-bottom: 1rem;
}

.review-summary .review-section:last-child {
  margin-bottom: 0;
}

.review-summary dl {
  margin: 0;
  display: grid;
  gap: 0.25rem;
}

.review-summary dt {
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.85rem;
}

.review-summary dd {
  margin: 0 0 0.5rem;
  color: var(--gray-900);
}

/* Buttons */
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

.btn {
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform 0.1s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--gray-900);
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-300);
  color: var(--gray-900);
}

/* Message blocks */
.message-block {
  padding: 1.75rem;
  border-radius: var(--radius);
  text-align: center;
  margin-top: 1rem;
}

.message-block .message-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.message-block h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.message-block p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--gray-700);
}

.message-block.success {
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.message-block.success .message-icon {
  color: var(--success);
}

.message-block.error {
  background: var(--error-bg);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.message-block.error .message-icon {
  color: var(--error);
}

/* Footer */
/* Autosave "progress restored" banner */
.autosave-banner {
  background: var(--primary);
  color: var(--gray-900);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  animation: autosaveBannerIn 0.3s ease;
}
.autosave-banner-hide {
  opacity: 0;
  transition: opacity 0.4s ease;
}
@keyframes autosaveBannerIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.footer a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}
