/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --green-50: #F0FDF4;
  --green-100: #DCFCE7;
  --green-500: #22C55E;
  --green-600: #16A34A;
  --red-50: #FEF2F2;
  --red-400: #F87171;
  --red-500: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --transition: 0.2s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 0;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
}

.header-subtitle {
  font-size: 14px;
  color: var(--gray-400);
}

/* ===== MAIN ===== */
.main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}

/* ===== SECTIONS ===== */
.section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.section:hover {
  box-shadow: var(--shadow-md);
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 0;
}

.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-500);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.section-desc {
  font-size: 13px;
  color: var(--gray-400);
}

.section-body {
  padding: 20px 28px 28px;
}

/* ===== FORM FIELDS ===== */
.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.required {
  color: var(--red-500);
}

/* Validación inline de campos */
.field-error input,
.field-error textarea,
.field-error select,
.field-error .input-with-suffix {
  border-color: var(--red-500) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.field-error-msg {
  display: block;
  color: var(--red-500);
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  animation: fadeInError 0.25s ease;
}

.tema-card.tema-error .tema-titulo-input {
  border-color: var(--red-500) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

@keyframes fadeInError {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-300);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== PHOTO UPLOAD ===== */
.medico-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  margin-bottom: 16px;
}

.foto-upload {
  width: 140px;
  height: 160px;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.foto-upload:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.foto-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--gray-300);
  font-size: 12px;
}

.foto-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.foto-upload.has-photo .foto-placeholder {
  display: none;
}

.foto-upload.has-photo .foto-preview {
  display: block;
}

.medico-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ===== OPTIONAL SECTION ===== */
.optional-section {
  border-top: 1px solid var(--gray-100);
  padding-top: 16px;
  margin-top: 8px;
}

.optional-section summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  user-select: none;
}

.optional-section summary::-webkit-details-marker {
  display: none;
}

.optional-section summary svg {
  transition: transform var(--transition);
}

.optional-section[open] summary svg {
  transform: rotate(180deg);
}

.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--gray-100);
  color: var(--gray-400);
}

.optional-fields {
  padding-top: 16px;
}

/* ===== TEMAS ===== */
.temas-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: var(--blue-50);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 20px;
}

.temas-info svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--blue-500);
}

/* Tema Card */
.tema-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tema-card.removing {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
    margin-bottom: 0;
    max-height: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
  }
}

.tema-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.tema-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.tema-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-600);
  background: var(--blue-100);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.tema-titulo-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  font-weight: 500;
  padding: 4px 8px !important;
  border-radius: 6px !important;
}

.tema-titulo-input:focus {
  background: var(--white) !important;
  border: 1px solid var(--gray-200) !important;
  box-shadow: none !important;
}

.btn-remove-tema {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--gray-300);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition);
}

.btn-remove-tema:hover {
  background: var(--red-50);
  color: var(--red-500);
}

.tema-content {
  padding: 16px;
}

.tema-section {
  margin-bottom: 20px;
}

.tema-section:last-child {
  margin-bottom: 0;
}

.tema-section h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.tema-section h4 svg {
  color: var(--gray-400);
}

.video-hint {
  font-weight: 400;
  color: var(--gray-400);
}

/* ===== FILE DROP ZONE ===== */
.file-drop-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--gray-400);
  font-size: 13px;
}

.drop-content svg {
  color: var(--gray-300);
}

.drop-content small {
  font-size: 11px;
  color: var(--gray-300);
}

/* File list */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: 13px;
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-icon {
  color: var(--blue-500);
  flex-shrink: 0;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-700);
}

.file-size {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
  margin-left: 8px;
}

.file-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--gray-300);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

.file-remove:hover {
  background: var(--red-50);
  color: var(--red-500);
}

/* ===== VIDEO OPTIONS ===== */
.video-options {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.video-option {
  cursor: pointer;
}

.video-option input {
  display: none;
}

.option-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 13px;
  color: var(--gray-500);
  transition: all var(--transition);
  user-select: none;
}

.video-option input:checked+.option-pill {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: var(--white);
}

.option-pill:hover {
  border-color: var(--blue-300);
}

/* ===== VIDEO RECORDER ===== */
.video-panel {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.recorder-container {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.recorder-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--gray-900);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Overlay "Encender cámara" */
.camera-activate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  border-radius: var(--radius-sm);
  z-index: 5;
  gap: 12px;
}

.camera-activate-overlay.hidden {
  display: none;
}

.btn-activate-camera {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: #0EA5E9;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  animation: pulse-camera 2s infinite;
}

.btn-activate-camera:hover {
  background: #0284C7;
  transform: scale(1.05);
}

.btn-activate-camera:disabled {
  opacity: 0.7;
  cursor: wait;
  animation: none;
}

.camera-activate-overlay p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  margin: 0;
}

@keyframes pulse-camera {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5); }
  50% { box-shadow: 0 0 0 14px rgba(14, 165, 233, 0); }
}

.recorder-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.recorder-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px;
  pointer-events: none;
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  background: rgba(239, 68, 68, 0.85);
  padding: 4px 12px;
  border-radius: 100px;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.rec-timer {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
}

.recorder-controls {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  justify-content: center;
}

.rec-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-700);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.rec-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.rec-btn-start {
  background: var(--red-500);
  border-color: var(--red-500);
  color: var(--white);
}

.rec-btn-start:hover {
  background: #DC2626;
  border-color: #DC2626;
}

.rec-btn-stop svg {
  color: var(--red-500);
}

.recorder-tip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-400);
  padding: 8px 0 0;
}

.recorder-tip svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== DEVICE CONTROLS ===== */
.device-controls {
  padding: 12px 0;
  border-top: 1px solid var(--gray-100);
  margin-top: 8px;
}

.device-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.device-select label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.device-select select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  color: var(--gray-700);
  background: var(--white);
  outline: none;
  cursor: pointer;
}

.device-select select:focus {
  border-color: var(--blue-400);
}

/* Audio meter row */
.audio-meter-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.vu-meter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.vu-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  white-space: nowrap;
}

.vu-db-label {
  font-size: 10px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

/* VU Meter — Light & Discrete */
.vu-meter {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 12px;
  flex: 1;
  padding: 3px 6px;
  background: var(--gray-100);
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

.vu-led {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200);
  transition: background 0.06s;
}

/* Blue LEDs — low level (0-6) */
.vu-led.active[data-led="0"],
.vu-led.active[data-led="1"],
.vu-led.active[data-led="2"],
.vu-led.active[data-led="3"],
.vu-led.active[data-led="4"],
.vu-led.active[data-led="5"],
.vu-led.active[data-led="6"] {
  background: var(--blue-400);
}

/* Amber LEDs — mid level (7-9) */
.vu-led.active[data-led="7"],
.vu-led.active[data-led="8"],
.vu-led.active[data-led="9"] {
  background: #F59E0B;
}

/* Orange-red LEDs — high level (10-11) */
.vu-led.active[data-led="10"],
.vu-led.active[data-led="11"] {
  background: var(--red-400);
}

/* Peak hold */
.vu-led.peak {
  opacity: 0.5;
}

/* Gain control */
.gain-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 120px;
}

.gain-control label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
}

.gain-slider-group {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.gain-label-min,
.gain-label-max {
  font-size: 10px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}

.gain-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--gray-200);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}

.gain-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue-500);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.gain-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue-500);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.gain-value {
  font-size: 10px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}

.recorded-preview video {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.recorded-info {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ===== YOUTUBE ===== */
.youtube-input-group {
  display: flex;
  gap: 8px;
}

.youtube-input-group input {
  flex: 1;
}

.btn-youtube-preview {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-youtube-preview:hover {
  border-color: var(--blue-400);
  color: var(--blue-500);
}

.youtube-preview-frame {
  margin-top: 12px;
}

.youtube-preview-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius-sm);
}

.no-video-msg {
  font-size: 13px;
  color: var(--gray-400);
  font-style: italic;
  padding: 12px 0;
}

/* Video file info */
.video-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--green-50);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray-700);
}

/* ===== ADD TEMA BUTTON ===== */
.btn-add-tema {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 2px dashed var(--gray-200);
  border-radius: 50%;
  background: var(--white);
  color: var(--gray-300);
  cursor: pointer;
  margin: 0 auto;
  transition: all var(--transition);
}

.btn-add-tema:hover {
  border-color: var(--blue-500);
  color: var(--blue-500);
  background: var(--blue-50);
  transform: scale(1.05);
}

.btn-add-tema:active {
  transform: scale(0.95);
}

.add-tema-label {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ===== PRICE ===== */
.price-field {
  max-width: 250px;
}

.input-with-suffix {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-with-suffix:focus-within {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-suffix input {
  border: none !important;
  box-shadow: none !important;
  padding-right: 0 !important;
}

.input-with-suffix input:focus {
  box-shadow: none !important;
}

.suffix {
  padding: 10px 14px;
  color: var(--gray-400);
  font-size: 16px;
  font-weight: 500;
  background: var(--gray-50);
  border-left: 1px solid var(--gray-200);
}

/* ===== SUBMIT AREA ===== */
.submit-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.total-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-500);
}

.total-size svg {
  color: var(--gray-300);
}

.btn-submit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--blue-500);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-submit:hover {
  background: var(--blue-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

.modal-icon {
  margin-bottom: 20px;
}

.modal h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.modal p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.progress-bar {
  height: 4px;
  background: var(--gray-100);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--blue-500);
  border-radius: 100px;
  width: 0%;
  transition: width 0.3s ease;
}

.spinner {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== HIDDEN ===== */
.hidden {
  display: none !important;
}

/* ===== LANDING SCREEN ===== */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 32px 24px;
}

.landing-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.landing-icon {
  margin-bottom: 16px;
}

.landing-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.landing-desc {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 24px;
  line-height: 1.5;
}

.landing-card .field {
  text-align: left;
}

/* Saved drafts */
.saved-drafts {
  margin-top: 24px;
  text-align: left;
  border-top: 1px solid var(--gray-100);
  padding-top: 20px;
}

.saved-drafts h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.draft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.draft-card:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.draft-card-info {
  min-width: 0;
}

.draft-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-card-meta {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

.draft-card-arrow {
  color: var(--gray-300);
  flex-shrink: 0;
}

/* ===== ACTION BAR (sticky bottom) ===== */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.action-bar-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.action-left {
  flex-shrink: 0;
}

.action-right {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Draft button */
.btn-draft {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-600);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-draft:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

.btn-draft:active {
  transform: scale(0.97);
}

/* Custom checkbox */
.checkbox-finalizado {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  user-select: none;
  white-space: nowrap;
}

.checkbox-finalizado input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  transition: all var(--transition);
  position: relative;
  flex-shrink: 0;
}

.checkbox-finalizado input:checked+.checkmark {
  background: var(--green-500);
  border-color: var(--green-500);
}

.checkbox-finalizado input:checked+.checkmark::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-finalizado input:checked~span:last-child {
  color: var(--green-600);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-800);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 200;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== SAVED DRAFTS (Landing) ===== */
.saved-drafts {
  margin-top: 24px;
  text-align: left;
  border-top: 1px solid var(--gray-100);
  padding-top: 20px;
}

.saved-drafts h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

#draftsContainer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.draft-item:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.draft-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.draft-info strong {
  font-size: 13px;
  color: var(--gray-800);
}

.draft-info span {
  font-size: 11px;
  color: var(--gray-400);
}

.btn-load-draft {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--blue-600);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-load-draft:hover {
  background: var(--blue-100);
  border-color: var(--blue-400);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .medico-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .foto-upload {
    width: 120px;
    height: 140px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .section-body {
    padding: 16px 20px 20px;
  }

  .section-header {
    padding: 20px 20px 0;
  }

  .action-bar-inner {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  .action-left {
    display: none;
  }

  .action-right {
    width: 100%;
  }

  .btn-draft,
  .btn-submit {
    flex: 1;
    justify-content: center;
  }

  .video-options {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .recorder-controls {
    flex-wrap: wrap;
  }
}