/* ========================================
   Secure Tax Document Portal - Styles
   ======================================== */

:root {
  --primary: #01062E;
  --primary-light: #0a1a4a;
  --accent: #FF9600;
  --accent-light: #FFaa20;
  --accent-glow: rgba(255, 150, 0, 0.10);
  --accent-secondary: #177FA3;
  --accent-secondary-light: #24ACDB;
  --danger: #dc3545;
  --warning: #f0ad4e;
  --surface: #ffffff;
  --surface-secondary: #f8f9fb;
  --surface-tertiary: #f0f2f5;
  --border: #e1e5eb;
  --border-light: #eef0f4;
  --text: #1a1d23;
  --text-secondary: #5f6b7a;
  --text-muted: #8a95a5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-secondary);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Security Banner */
.security-banner {
  background: var(--primary);
  color: rgba(255,255,255,0.9);
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
}

.security-banner svg {
  color: var(--accent);
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), #FFb830);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(23, 127, 163, 0.1);
  color: var(--accent-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(23, 127, 163, 0.2);
}

/* Progress */
.progress-container {
  max-width: 800px;
  margin: 24px auto 0;
  padding: 0 24px;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 33%;
}

.steps {
  display: flex;
  justify-content: space-between;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-tertiary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step.active .step-number {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.step.active {
  color: var(--text);
}

.step.completed .step-number {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

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

/* Main Content */
.main-content {
  max-width: 800px;
  margin: 24px auto;
  padding: 0 24px 48px;
}

.form-section {
  display: none;
}

.form-section.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

.section-header {
  margin-bottom: 28px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Forms */
.client-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.required {
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* SIN masking via CSS (avoids Chrome phishing warning from type="password") */
.sin-masked {
  -webkit-text-security: disc;
  -moz-text-security: disc;
  text-security: disc;
}

.sin-input-wrapper {
  position: relative;
}

.sin-input-wrapper input {
  padding-right: 44px;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

.sin-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
}

.sin-toggle:hover {
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

.field-note {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  flex: 1;
  min-width: 140px;
}

.radio-option:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.radio-option input {
  display: none;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.radio-option input:checked ~ .radio-custom {
  border-color: var(--accent);
}

.radio-option input:checked ~ .radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-submit {
  background: linear-gradient(135deg, var(--accent), #FFb830);
  color: white;
  padding: 14px 32px;
  font-size: 15px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 150, 0, 0.3);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-tertiary);
  color: var(--text);
}

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--border);
  width: 100%;
  justify-content: center;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--surface-secondary);
}

.btn-next {
  margin-left: auto;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

/* Checklist */
.checklist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.checklist-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.checklist-item:hover {
  background: var(--surface-secondary);
}

.checklist-item input {
  display: none;
}

.checklist-item .check-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.checklist-item input:checked ~ .check-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checklist-item input:checked ~ .check-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist-item strong {
  font-size: 13px;
  display: block;
  line-height: 1.3;
}

.checklist-item small {
  font-size: 11px;
  color: var(--text-muted);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--surface);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone.drag-over {
  transform: scale(1.01);
}

.upload-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: var(--surface-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-secondary);
}

.upload-zone h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-zone p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.upload-specs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.dot-sep {
  opacity: 0.4;
}

.file-input-hidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Mobile Camera */
.mobile-capture {
  margin-top: 12px;
  display: none;
}

@media (max-width: 768px) {
  .mobile-capture {
    display: block;
  }
}

/* File List */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.file-icon.pdf {
  background: #fef2f2;
  color: #dc3545;
}

.file-icon.img {
  background: #eff6ff;
  color: #3b82f6;
}

.file-icon.xls {
  background: #f0fdf4;
  color: #16a34a;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 11px;
  color: var(--text-muted);
}

.file-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-secondary);
}

.file-status svg {
  flex-shrink: 0;
}

.file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}

.file-remove:hover {
  color: var(--danger);
  background: #fef2f2;
}

/* Upload Status */
.upload-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(23, 127, 163, 0.08);
  border: 1px solid rgba(23, 127, 163, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-secondary);
}

/* Review Card */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.review-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

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

.review-item {
  font-size: 13px;
}

.review-item .label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.review-item .value {
  color: var(--text);
  font-weight: 500;
  margin-top: 2px;
}

.review-divider {
  height: 1px;
  background: var(--border-light);
  margin: 20px 0;
}

.review-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 0;
}

.review-file svg {
  color: var(--accent-secondary);
  flex-shrink: 0;
}

/* Consent */
.consent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.consent-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--primary);
}

.consent-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.consent-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.consent-text ul {
  margin: 8px 0 16px 20px;
}

.consent-text li {
  margin-bottom: 6px;
}

.consent-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  background: var(--surface-secondary);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  transition: all 0.2s ease;
}

.consent-checkbox:hover {
  border-color: var(--accent);
}

.consent-checkbox input {
  display: none;
}

.consent-checkbox .check-custom {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.consent-checkbox input:checked ~ .check-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.consent-checkbox input:checked ~ .check-custom::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Confirmation */
.confirmation-container {
  text-align: center;
  padding: 32px 0;
}

.success-icon {
  width: 100px;
  height: 100px;
  background: rgba(23, 127, 163, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--accent-secondary);
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  50% { transform: scale(1.1); }
  to { transform: scale(1); }
}

.confirmation-container h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.confirmation-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.confirmation-details {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.confirmation-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-width: 180px;
}

.conf-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.conf-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.next-steps-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: left;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.next-steps-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
}

.next-steps-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.next-step {
  display: flex;
  gap: 14px;
}

.next-step-num {
  width: 32px;
  height: 32px;
  background: rgba(23, 127, 163, 0.1);
  color: var(--accent-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.next-step strong {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.next-step p {
  font-size: 13px;
  color: var(--text-secondary);
}

.confirmation-contact {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-security {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 24px;
}

.security-items {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.security-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.security-item svg {
  color: var(--accent-secondary);
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  text-align: center;
  padding: 16px 24px;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-muted);
}

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

  .header-security {
    display: none;
  }

  .radio-group {
    flex-direction: column;
  }

  .steps span {
    display: none;
  }

  .steps {
    justify-content: center;
    gap: 32px;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .confirmation-details {
    flex-direction: column;
    align-items: center;
  }

  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .upload-zone {
    padding: 32px 16px;
  }

  .type-selector-cards {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================
   Filing Type Selector (Step 0)
   ======================================== */
.type-selector-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.type-selector-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: inherit;
  color: inherit;
}

.type-selector-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.type-selector-card:hover .type-selector-cta {
  color: var(--accent);
  gap: 8px;
}

.type-selector-icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 150, 0, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}

.type-selector-icon.self-employed {
  background: rgba(23, 127, 163, 0.08);
  color: var(--accent-secondary);
}

.type-selector-icon.corporate {
  background: rgba(1, 6, 46, 0.06);
  color: var(--primary);
}

.type-selector-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.type-selector-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.type-selector-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.type-selector-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.type-selector-security svg {
  color: var(--accent-secondary);
  flex-shrink: 0;
}

/* Filing type badge (shown in Step 1 after selection) */
.filing-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--accent-glow);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.filing-type-change {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.filing-type-change:hover {
  color: var(--accent-light);
}

/* ========================================
   Form Section Headings & Layout
   ======================================== */

.form-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-top: 28px;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--border);
}

.form-section-heading svg {
  color: var(--accent-secondary);
  flex-shrink: 0;
}

.form-section-heading h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
}

/* 3-column row */
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
}

.form-row-3 .form-group:nth-child(2) {
  /* Middle initial column — narrow */
  min-width: 80px;
  max-width: 100px;
}

/* Address row: street wider, apt narrower */
.form-row-addr {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* Conditional sections */
.conditional-section {
  background: var(--surface-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 4px;
  animation: fadeIn 0.3s ease;
}

.conditional-field {
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.form-subsection-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-bottom: 16px;
}

.form-subsection-heading svg {
  flex-shrink: 0;
}

/* Inline checkbox (different province, etc.) */
.inline-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding: 8px 0;
}

.inline-checkbox input {
  display: none;
}

.check-custom-sm {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.inline-checkbox input:checked ~ .check-custom-sm {
  background: var(--accent);
  border-color: var(--accent);
}

.inline-checkbox input:checked ~ .check-custom-sm::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ========================================
   Yes/No Toggle Questions
   ======================================== */

.yn-questions {
  display: flex;
  flex-direction: column;
}

.yn-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.yn-question:last-child {
  border-bottom: none;
}

.yn-label {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
}

.yn-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.yn-option {
  cursor: pointer;
  margin: 0;
}

.yn-option input {
  display: none;
}

.yn-option span {
  display: block;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.2s ease;
  border-right: 1px solid var(--border);
}

.yn-option:last-child span {
  border-right: none;
}

.yn-option input:checked + span {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

/* ========================================
   T4 Slip Cards
   ======================================== */

.form-section-optional {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: auto;
}

.slip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  animation: fadeIn 0.3s ease;
}

.slip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.slip-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-secondary);
}

.slip-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}

.slip-remove-btn:hover {
  color: var(--danger);
  background: #fef2f2;
}

.slip-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.slip-box-group {
  display: flex;
  flex-direction: column;
}

.slip-box-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.slip-box-group .slip-box-desc {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slip-box-group input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s ease;
}

.slip-box-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.slip-box-group input::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

.btn-add-slip {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  border-style: dashed;
  color: var(--text-secondary);
}

.btn-add-slip:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
  background: rgba(23, 127, 163, 0.04);
}

/* T4 review summary */
.review-t4-slip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.review-t4-slip:last-child {
  border-bottom: none;
}

.review-t4-slip strong {
  width: 100%;
  color: var(--primary);
}

.review-t4-slip span {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ========================================
   Responsive — Form Sections
   ======================================== */

@media (max-width: 640px) {
  .form-row-3 {
    grid-template-columns: 1fr 80px;
    gap: 12px;
  }

  .form-row-3 .form-group:nth-child(2) {
    max-width: none;
  }

  .form-row-3 .form-group:nth-child(3) {
    grid-column: 1 / -1;
  }

  .form-row-addr {
    grid-template-columns: 1fr;
  }

  .yn-question {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .yn-toggle {
    align-self: flex-end;
  }

  .conditional-section {
    padding: 16px;
  }

  .slip-boxes {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-section-optional {
    display: none;
  }
}

/* ========================================
   T4 Step (Step 2)
   ======================================== */

.t4-option-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 0;
}

.t4-option-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.t4-option-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.t4-option-header svg {
  color: var(--accent-secondary);
  flex-shrink: 0;
}

.t4-option-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

.t4-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}

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

.t4-divider span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.upload-zone-sm {
  padding: 24px 16px;
  min-height: auto;
}

.upload-zone-sm .upload-zone-content {
  gap: 4px;
}

.upload-zone-sm .upload-zone-content p {
  margin: 0;
  font-size: 13px;
}

.upload-specs-sm {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

#t4FileList {
  margin-top: 12px;
}

#t4FileList .file-item {
  margin-bottom: 6px;
}

/* ========================================
   Self-Filing Terms Modal
   ======================================== */

.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(1, 6, 46, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: termsOverlayIn 0.25s ease;
}

.terms-overlay.hidden {
  display: none;
}

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

.terms-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 660px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: termsModalIn 0.3s ease;
}

@keyframes termsModalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.terms-modal-header {
  padding: 28px 32px 16px;
  text-align: center;
  flex-shrink: 0;
}

.terms-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  margin-bottom: 12px;
}

.terms-modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.3;
}

.terms-modal-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.terms-modal-body {
  padding: 0 32px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.terms-modal-body p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 0 10px;
  line-height: 1.65;
}

.terms-modal-body ul {
  margin: 0 0 12px 8px;
  padding-left: 16px;
}

.terms-modal-body li {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.55;
}

.terms-modal-body strong {
  color: var(--text);
}

.terms-modal-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.terms-modal-body h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  margin: 18px 0 6px;
}

.terms-toggle-full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 4px;
}

.terms-toggle-full:hover {
  color: var(--accent-secondary-light);
  text-decoration: underline;
}

.terms-modal-footer {
  padding: 16px 32px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.terms-checkbox input[type="checkbox"] {
  display: none;
}

.terms-checkbox .check-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.terms-checkbox input:checked + .check-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.terms-checkbox input:checked + .check-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.terms-modal-footer .btn {
  width: 100%;
  max-width: 320px;
  justify-content: center;
  font-size: 15px;
  padding: 14px 24px;
}

@media (max-width: 640px) {
  .terms-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .terms-modal {
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .terms-modal-header {
    padding: 20px 20px 12px;
  }

  .terms-modal-header h2 {
    font-size: 17px;
  }

  .terms-modal-body {
    padding: 0 20px;
  }

  .terms-modal-footer {
    padding: 14px 20px 20px;
  }
}
