:root {
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --surface-color: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow-sm: 0 2px 4px rgba(148, 163, 184, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(148, 163, 184, 0.1), 0 2px 4px -1px rgba(148, 163, 184, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(148, 163, 184, 0.1), 0 4px 6px -2px rgba(148, 163, 184, 0.05);
  --neumorphic-shadow: 6px 6px 12px #e2e8f0, -6px -6px 12px #ffffff;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--surface-color);
  color: var(--text-primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.header {
  text-align: center;
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: var(--primary-gradient);
}

.header h1 {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.025em;
}

/* Form Elements with Neumorphic Style */
.form-group {
  margin-bottom: 2.5rem;
}

/* Enhanced DateTime Input */
input[type="datetime-local"] {
  width: 100%;
  padding: 1.25rem 3rem 1.25rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: var(--card-bg);
  box-shadow: inset 2px 2px 5px #e2e8f0, inset -2px -2px 5px #ffffff;
  transition: all 0.3s;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  background: var(--primary-gradient);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}

/* Enhanced Select Dropdown */
select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 1.25rem 3rem 1.25rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: var(--card-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5rem;
  cursor: pointer;
  box-shadow: inset 2px 2px 5px #e2e8f0, inset -2px -2px 5px #ffffff;
  transition: all 0.3s;
}

select:hover, input[type="datetime-local"]:hover {
  border-color: var(--primary-color);
}

select:focus, input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: inset 2px 2px 5px #e2e8f0, inset -2px -2px 5px #ffffff,
              0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  font-size: 1rem;
  background: var(--card-bg);
  box-shadow: inset 2px 2px 5px #e2e8f0, inset -2px -2px 5px #ffffff;
  transition: all 0.3s;
  min-height: 120px;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: inset 2px 2px 5px #e2e8f0, inset -2px -2px 5px #ffffff,
              0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Enhanced Checkbox Containers */
.checkbox-container {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.checkbox-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.checkbox-container input {
  opacity: 0;
  position: absolute;
}

.checkmark {
  position: relative;
  height: 28px;
  width: 28px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  margin-right: 1rem;
  box-shadow: inset 2px 2px 5px #e2e8f0, inset -2px -2px 5px #ffffff;
  transition: all 0.3s;
}

.checkbox-container:hover .checkmark {
  border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
  background: var(--primary-gradient);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

/* IP Reject Cards */
.ip-reject-panel {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface-color);
  border-radius: 1.25rem;
  box-shadow: var(--neumorphic-shadow);
}

.ip-reject-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.ip-reject-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.ip-reject-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.ip-reject-card .card-header {
  background: var(--primary-gradient);
  padding: 1.25rem 1.5rem;
  color: white;
}

.ip-reject-card .card-header h4 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.ip-reject-card .ip-range {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.ip-reject-card .card-content {
  padding: 1.5rem;
}

.ip-reject-card .reason {
  color: #dc2626;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.ip-reject-card .explanation {
  color: var(--text-secondary);
  margin: 0 0 1.25rem 0;
}

.ip-reject-card .steps {
  background: var(--surface-color);
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 1rem;
}

.ip-reject-card .steps ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.5rem;
}

.ip-reject-card .steps li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  position: relative;
}

.ip-reject-card .steps li::before {
  content: '→';
  position: absolute;
  left: -1.25rem;
  color: var(--primary-color);
}

/* Buttons */
.prev-btn,
.next-btn,
.submit-btn {
  padding: 1rem 2rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.025em;
  transition: all 0.3s;
  border: none;
  box-shadow: var(--shadow-md);
}

.next-btn,
.submit-btn {
  background: var(--primary-gradient);
  color: white;
}

.next-btn:hover,
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.prev-btn {
  background: var(--surface-color);
  color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
  height: 0.75rem;
  background: var(--surface-color);
  border-radius: 1rem;
  margin-bottom: 3rem;
  overflow: hidden;
  box-shadow: inset 2px 2px 5px #e2e8f0, inset -2px -2px 5px #ffffff;
}

.progress {
  height: 100%;
  background: var(--primary-gradient);
  transition: width 0.4s ease;
}

/* Guidance Panels */
.guidance-panel {
  background: var(--card-bg);
  border-radius: 1.25rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--neumorphic-shadow);
  overflow: hidden;
}

.guidance-header {
  background: var(--primary-gradient);
  padding: 1.25rem 1.5rem;
  color: white;
}

.guidance-content {
  padding: 1.75rem;
}

/* Response Sections */
.response-section {
  margin: 2rem 0;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 1.25rem;
  box-shadow: var(--neumorphic-shadow);
}

.response-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.response-section-title {
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.response-section-content {
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  font-size: 0.925rem;
  line-height: 1.7;
  background: var(--surface-color);
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  max-width: 100%;
  word-wrap: break-word;
}

pre.response-section-content {
  margin: 0;
}

.copy-section-button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  margin-left: 1rem;
}

@media (max-width: 768px) {
  .response-section {
    padding: 1.25rem;
  }
  
  .response-section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    text-align: left;
  }
  
  .copy-section-button {
    margin-left: 0;
    width: 100%;
  }
  
  .response-section-content {
    font-size: 0.875rem;
    padding: 1rem;
  }
}

/* Portal Links */
.portal-links-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.portal-link {
  display: inline-flex;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border-radius: 1rem;
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: var(--neumorphic-shadow);
  transition: all 0.3s;
}

.portal-link:hover {
  background: var(--primary-gradient);
  color: white;
  transform: translateY(-2px);
}

.external-link-icon {
  margin-left: 0.75rem;
  transition: transform 0.2s;
}

.portal-link:hover .external-link-icon {
  transform: translateX(2px);
}

/* Alert Styles */
.guidance-warning,
.guidance-tip,
.guidance-note {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
}

.guidance-warning::before,
.guidance-tip::before,
.guidance-note::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.guidance-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.guidance-warning::before {
  background: #f97316;
}

.guidance-tip {
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.guidance-tip::before {
  background: #22c55e;
}

.guidance-note {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.guidance-note::before {
  background: #3b82f6;
}

/* Error Display */
.error {
  color: #dc2626;
  background: #fee2e2;
  padding: 1.25rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid #fecaca;
  box-shadow: var(--shadow-sm);
}

/* Responsive Design */
@media (max-width: 768px) {
  body { 
    padding: 1rem;
  }
  
  .container {
    padding: 1.5rem;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .portal-links-container {
    flex-direction: column;
  }
  
  .portal-link {
    width: 100%;
    justify-content: center;
  }
  
  .prev-btn,
  .next-btn,
  .submit-btn {
    width: 100%;
    margin: 0.5rem 0;
  }
  
  .ip-reject-cards {
    grid-template-columns: 1fr;
  }
  
  .response-section-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .response-section-header::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .copy-section-button {
    width: 100%;
  }
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  body {
    background: white;
    padding: 0;
  }

  .container {
    max-width: none;
    margin: 0;
    padding: 1rem;
    box-shadow: none;
  }

  .prev-btn,
  .next-btn,
  .copy-section-button {
    display: none;
  }

  .guidance-panel,
  .response-section,
  .ip-reject-panel {
    page-break-inside: avoid;
    box-shadow: none;
  }
}

/* IP Reject Panel Styles */
.ip-reject-panel {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface-color);
  border-radius: 1.25rem;
  box-shadow: var(--neumorphic-shadow);
}

.guidance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.guidance-header .collapse-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.guidance-header.collapsed .collapse-icon {
  transform: rotate(-180deg);
}

.ip-reject-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-height: 1000px;
  opacity: 1;
  transition: all 0.3s ease;
  overflow: hidden;
}

.ip-reject-cards.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 1rem;
  margin: 0;
}