/* Modern Design System */
:root {
  color-scheme: light;
  
  /* Color Palette */
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  
  /* Text Colors */
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  
  /* Border & Lines */
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-border-focus: #6366f1;
  
  /* Primary Accent - Indigo */
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: #e0e7ff;
  
  /* Success/Error States */
  --color-success: #10b981;
  --color-error: #ef4444;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--color-text-primary);
  background: var(--color-bg);
  min-height: 100vh;
  padding: var(--space-6);
}

/* Layout */
.shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-8) 0;
}

/* Hero Section */
.hero {
  margin-bottom: var(--space-8);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(1.875rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
  color: var(--color-text-primary);
}

.lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* Card */
.panel {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* Form */
.form {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Grid Layout */
.grid {
  display: grid;
  gap: var(--space-6);
}

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

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

/* Form Fields */
label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

label span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

label span small {
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: var(--space-1);
}

/* Inputs */
input,
select,
textarea {
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-border-hover);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Select styling */
select {
  appearance: none;
  background-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='%23475569' 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 var(--space-3) center;
  padding-right: var(--space-10);
  cursor: pointer;
}

/* Textarea */
textarea {
  resize: vertical;
  min-height: 120px;
}

/* File Upload */
.file-input-label {
  cursor: pointer;
}

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

.file-input-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  min-height: 140px;
  transition: all var(--transition-fast);
}

.file-input-preview:hover,
.file-input-label:focus-within .file-input-preview {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.02);
}

.file-input-preview.drag-over {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.05);
}

.file-input-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-align: center;
  flex: 1;
}

.file-input-placeholder::before {
  content: "";
  width: 40px;
  height: 40px;
  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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='17 8 12 3 7 8'%3E%3C/polyline%3E%3Cline x1='12' y1='3' x2='12' y2='15'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.5;
}

/* File Preview List */
.file-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-3);
}

.file-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.file-preview-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-item .remove-btn {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  color: white;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: all var(--transition-fast);
}

.file-preview-item:hover .remove-btn {
  opacity: 1;
}

.file-preview-item .remove-btn:hover {
  background: var(--color-error);
}

.file-count {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* Actions */
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2);
}

@media (max-width: 640px) {
  .actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}

/* Button */
button {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-8);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

button:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Status Messages */
.status {
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status:empty {
  display: none;
}

.status.success {
  color: var(--color-success);
}

.status.success::before {
  content: "";
  width: 16px;
  height: 16px;
  background-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='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

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

.status.error::before {
  content: "";
  width: 16px;
  height: 16px;
  background-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='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Honeypot */
.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: var(--space-4);
  }
  
  .shell {
    padding: var(--space-4) 0;
  }
  
  .hero {
    margin-bottom: var(--space-6);
  }
  
  .form {
    padding: var(--space-5);
  }
  
  .grid.two {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  
  .actions {
    flex-direction: column-reverse;
    gap: var(--space-3);
  }
  
  button {
    width: 100%;
  }
  
  .hint {
    text-align: center;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel {
  animation: fadeIn 0.4s ease-out;
}
