:root {
  --orange: #f2622e;
  --orange-dark: #d9501f;
  --cyan: #0fae96;
  --cyan-bg: #e3faf5;
  --cyan-text: #0b8a76;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c1f26;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text);
}

.container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  max-width: 720px;
  width: 100%;
  padding: 40px;
  position: relative;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 3px;
  background: var(--orange);
  border-radius: 0 0 3px 3px;
}

h1 {
  text-align: center;
  color: var(--text);
  margin-bottom: 10px;
  font-size: 32px;
  font-weight: 700;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 14px;
}

.form-group { margin-bottom: 25px; }

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.file-input-wrapper { position: relative; display: inline-block; width: 100%; }
.file-input { display: none; }

.file-label {
  display: block;
  padding: 28px 20px;
  background: var(--bg);
  border: 2px dashed var(--cyan);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  color: var(--cyan-text);
  font-weight: 500;
}

.file-label:hover { background: var(--cyan); color: white; border-color: var(--cyan); }

.dropzone.drag-over {
  background: var(--orange);
  border-color: var(--orange);
  border-style: solid;
  color: white;
}

.file-name {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--cyan-text);
  font-weight: 600;
  font-family: var(--font-mono);
}

.file-label.filled {
  border-style: solid;
  cursor: default;
  pointer-events: none;
}

.clear-file-btn {
  width: auto;
  margin: 8px auto 0;
  display: block;
  padding: 4px 10px;
  background: transparent;
  color: var(--orange-dark);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.clear-file-btn:hover:not(:disabled) {
  background: transparent;
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}

button {
  width: 100%;
  padding: 15px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

button:hover:not(:disabled) {
  background: var(--orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(242, 98, 46, 0.35);
}

button:disabled { opacity: 0.6; cursor: not-allowed; }

#resultado {
  margin-top: 30px;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  display: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.resultado-success {
  background: var(--cyan-bg);
  color: var(--cyan-text);
  border: 1px solid var(--cyan);
  display: block !important;
}

.resultado-error {
  background: #fdeceb;
  color: var(--orange-dark);
  border: 1px solid var(--orange);
  display: block !important;
}

.resultado-loading {
  background: #f0f4f8;
  color: var(--text-muted);
  border: 1px solid var(--border);
  display: block !important;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

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

#upload-fields.locked {
  opacity: 0.45;
  filter: grayscale(0.3);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.otp-wrapper {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.otp-box {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.otp-box:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 98, 46, 0.15);
}

.otp-box:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--border);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 31, 38, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: var(--card);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-icon { font-size: 40px; margin-bottom: 10px; }

.modal-progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 8px;
}

.modal-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--orange);
  border-radius: 999px;
  transition: width 0.15s ease;
}

.modal-progress-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 4px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal-box h2 { margin-bottom: 8px; color: var(--text); }

.modal-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 22px; }

.modal-download-btn {
  width: 100%;
  padding: 14px;
  background: var(--cyan);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}

.modal-download-btn:hover { background: var(--cyan-text); }

.modal-close-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 13px;
  cursor: pointer;
}

.info-box {
  background: var(--cyan-bg);
  border-left: 4px solid var(--cyan);
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--cyan-text);
}
