* { box-sizing: border-box; }

body { margin: 0; }

button, select { font: inherit; }

button:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tm-laranja) 35%, transparent);
  outline-offset: 2px;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 56px 20px;
  background: var(--bg-page);
}

.brand-logo { width: min(320px, 72vw); height: auto; opacity: .85; }

.converter-card {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 48px 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.hero { display: flex; flex-direction: column; gap: 16px; }
.hero-icon, .file-icon { display: grid; place-items: center; color: var(--tm-laranja); }
.hero-icon { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--tm-laranja-tint); }
.hero-icon svg { width: 28px; }
.hero h1 { margin-bottom: 12px; font-size: 34px; }
.hero p { color: var(--fg-muted); font-size: 17px; line-height: 1.55; }

#conversion-form { display: flex; flex-direction: column; gap: 28px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field label, .field-label { color: var(--fg-default); font-size: 14px; font-weight: 700; }

.select-wrapper { position: relative; }
.select-wrapper select {
  width: 100%; height: 52px; padding: 0 44px 0 16px;
  color: var(--fg-default); background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  appearance: none; cursor: pointer;
}
.select-wrapper select:disabled { cursor: not-allowed; opacity: .65; }
.select-wrapper svg { position: absolute; right: 16px; top: 50%; width: 18px; color: var(--fg-muted); transform: translateY(-50%); pointer-events: none; }

.dropzone {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 24px; color: var(--fg-muted); text-align: center;
  background: var(--bg-sunken); border: 2px dashed var(--border-default); border-radius: 16px;
  cursor: pointer; transition: border-color var(--dur), background var(--dur);
}
.dropzone:hover, .dropzone.is-dragging { border-color: var(--tm-laranja); background: var(--tm-laranja-tint); }
.dropzone svg { width: 34px; color: var(--tm-laranja); }
.dropzone strong { color: var(--fg-default); font-size: 16px; }
.dropzone u { color: var(--tm-laranja); }
.dropzone small { color: var(--fg-subtle); }

.selected-file { align-items: center; gap: 16px; padding: 18px 20px; background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: 14px; }
.selected-file:not([hidden]) { display: flex; }
.file-icon { flex: none; width: 44px; height: 44px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; }
.file-icon svg, .icon-button svg { width: 22px; }
.file-details { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-details strong { overflow: hidden; color: var(--fg-default); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.file-details span { margin-top: 2px; color: var(--fg-muted); font-size: 13px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--fg-muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.icon-button:hover { background: var(--n-200); color: var(--fg-default); }

.primary-button {
  width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 20px; color: white; background: var(--tm-laranja); border: 0;
  border-radius: var(--radius-md); box-shadow: var(--shadow-brand);
  font-family: var(--font-display); font-size: 18px; font-weight: 800; cursor: pointer;
}
.primary-button:disabled { color: var(--n-500); background: var(--n-200); box-shadow: none; cursor: not-allowed; }
.spinner { display: none; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.feedback { align-items: flex-start; gap: 14px; padding: 20px 22px; border-radius: 14px; }
.feedback:not([hidden]) { display: flex; }
.feedback.success { background: var(--success-bg); border: 1px solid rgba(31,164,99,.28); }
.feedback.error { background: var(--danger-bg); border: 1px solid rgba(217,45,32,.25); }
.feedback-icon { flex: none; width: 24px; }
.feedback.success .feedback-icon { color: var(--success); }
.feedback.error .feedback-icon { color: var(--danger); }
.feedback strong { color: var(--fg-default); font-size: 16px; }
.feedback p { margin-top: 4px; color: var(--fg-muted); font-size: 14px; line-height: 1.5; }

.text-button { align-self: center; padding: 4px; color: var(--fg-muted); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.privacy-note { display: flex; align-items: flex-start; gap: 12px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.privacy-note svg { flex: none; width: 20px; margin-top: 2px; color: var(--fg-subtle); }
.privacy-note p { color: var(--fg-subtle); font-size: 14px; line-height: 1.55; }

[hidden] { display: none !important; }

@media (max-width: 600px) {
  .page-shell { justify-content: flex-start; gap: 24px; padding: 28px 14px; }
  .brand-logo { width: min(260px, 68vw); }
  .converter-card { gap: 26px; padding: 30px 22px; border-radius: var(--radius-lg); }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 16px; }
  .dropzone { padding: 32px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
