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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #232733;
  --border: #2e3344;
  --text: #e8eaef;
  --text-muted: #8b92a5;
  --accent: #5b8def;
  --accent-hover: #4a7de0;
  --accent-glow: rgba(91, 141, 239, 0.25);
  --success: #3ecf8e;
  --success-hover: #35b87d;
  --danger: #ef5b5b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 141, 239, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(62, 207, 142, 0.06), transparent);
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* Header */
.header {
  margin-bottom: 2rem;
}

.header__brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.header__icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Cards */
.main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: opacity var(--transition), border-color var(--transition);
}

.card--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.card:not(.card--disabled) {
  opacity: 1;
  pointer-events: auto;
}

.card__title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone--dragover {
  border-color: var(--accent);
  background: rgba(91, 141, 239, 0.06);
}

.dropzone__icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.dropzone__label {
  font-size: 1.05rem;
  font-weight: 500;
}

.dropzone__hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.dropzone__limit {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.75rem;
  opacity: 0.7;
}

.dropzone__file {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  padding: 0.25rem;
}

.file-info__icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  flex-shrink: 0;
}

.file-info__details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.file-info__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--accent-hover);
}

/* Field groups */
.field-group {
  border: none;
  margin-bottom: 1.25rem;
}

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

.field-group__legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

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

.radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.75rem;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(91, 141, 239, 0.1);
}

.radio-card__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.radio-card__label {
  font-size: 0.82rem;
  font-weight: 500;
}

.radio-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.radio-row:hover {
  background: #2a2f3d;
}

.radio-row input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

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

.range-input {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.range-input label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.range-input input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.range-input input[type="text"]:focus {
  border-color: var(--accent);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.field-hint--error {
  color: var(--danger);
}

/* Progress */
.progress-area {
  margin-bottom: 1.25rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.88rem;
  font-weight: 500;
}

.progress-percent {
  font-size: 0.88rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #7aa3f5);
  border-radius: 99px;
  transition: width 0.15s ease;
}

.progress-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Buttons */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition), transform 0.1s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

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

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn--success {
  background: var(--success);
  color: #0f1117;
}

.btn--success:hover {
  background: var(--success-hover);
}

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

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

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn--sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.btn__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Status */
.status-msg {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
}

.status-msg--error {
  background: rgba(239, 91, 91, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 91, 91, 0.25);
}

.status-msg--success {
  background: rgba(62, 207, 142, 0.12);
  color: var(--success);
  border: 1px solid rgba(62, 207, 142, 0.25);
}

/* Footer */
.footer {
  margin-top: 2.5rem;
  text-align: center;
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Utilities */
.hidden {
  display: none !important;
}
