:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #14161b;
  background: #f5f6f8;
  font-synthesis: none;
  --ink: #111317;
  --muted: #697386;
  --line: #dfe3e9;
  --orange: #ff8a00;
  --orange-dark: #d96f00;
  --cyan: #00cbd3;
  --green: #00d45a;
  --green-dark: #08783a;
  --red: #c23b3b;
  --paper: rgba(255, 255, 255, .97);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 138, 0, .14), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(0, 203, 211, .14), transparent 30%),
    #f5f6f8;
}
button, input { font: inherit; }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 40px; }

.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 24px 26px;
  overflow: hidden;
  border: 1px solid rgba(17, 19, 23, .08);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,.99), rgba(250,252,252,.94));
  box-shadow: 0 18px 48px rgba(17, 19, 23, .08);
}
.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  border: 34px solid rgba(255, 138, 0, .09);
  border-radius: 50%;
  pointer-events: none;
}
.brand-lockup { display: flex; align-items: center; gap: 24px; min-width: 0; }
.brand-logo { width: 170px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 8px 13px rgba(17,19,23,.12)); }
.hero-copy { min-width: 0; }
.eyebrow { margin: 0 0 7px; font-size: 12px; font-weight: 900; letter-spacing: .18em; color: var(--orange-dark); }
h1 { margin: 0; font-size: clamp(32px, 5.2vw, 56px); line-height: 1; letter-spacing: -.045em; color: var(--ink); }
.subtitle { max-width: 730px; margin: 12px 0 0; color: #596275; font-size: 16px; line-height: 1.55; }
.version { position: relative; z-index: 1; padding: 8px 12px; border-radius: 999px; background: #fff0dd; color: #a65000; border: 1px solid #ffd09b; font-size: 12px; font-weight: 900; white-space: nowrap; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 14px 40px rgba(28, 34, 45, .07); }
.action-card { padding: 24px 26px; }
.start-form { display: grid; grid-template-columns: minmax(240px, 360px) minmax(230px, 1fr); gap: 18px; align-items: end; }
.date-field label { display: block; margin-bottom: 8px; font-weight: 900; color: #263044; }
.date-field input { width: 100%; min-height: 52px; border: 1px solid #cbd3df; border-radius: 13px; padding: 0 14px; color: #202735; background: #fff; outline: none; }
.date-field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0, 203, 211, .14); }
.start-button { min-height: 52px; border: 0; border-radius: 14px; padding: 0 22px; background: linear-gradient(90deg, #111317 0%, #262a31 72%, #4a2e0d 100%); color: #fff; font-weight: 900; cursor: pointer; box-shadow: inset 5px 0 0 var(--orange), 0 12px 26px rgba(17,19,23,.14); }
.start-button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.start-button:disabled { opacity: .62; cursor: wait; transform: none; }
.button-mark { margin-right: 8px; color: var(--orange); }
.action-note { margin: 13px 0 0; color: var(--muted); font-size: 13px; }

.status-card { margin-top: 20px; padding: 24px; }
.section-heading, .result-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
h2 { margin: 0 0 5px; font-size: 21px; color: var(--ink); }
.section-heading p, .result-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.date-label { margin-top: 6px !important; font-weight: 850; color: #344158 !important; }
.badge { border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.badge.neutral { background: #edf0f4; color: #667085; }
.badge.working { background: #fff0dd; color: #995000; }
.badge.success { background: #dcf8e8; color: #126238; }
.badge.danger { background: #ffe5e5; color: #a12d2d; }

.overall-progress { height: 9px; margin-top: 20px; overflow: hidden; border-radius: 999px; background: #e9edf2; }
.overall-progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .35s ease; }
.overall-progress-text { margin: 8px 0 0; color: #657086; font-size: 12px; font-weight: 800; text-align: right; }

.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.platform-item { min-width: 0; padding: 15px; border: 1px solid #e2e6ed; border-radius: 14px; background: #fbfcfd; transition: border-color .25s ease, background .25s ease; }
.platform-item.running { border-color: #f1cc94; background: #fffaf1; }
.platform-item.completed { border-color: #b7e7ca; background: #f6fcf8; }
.platform-item.skipped { border-color: #c9d1dc; background: #f4f6f8; }
.platform-item.error, .platform-item.cancelled { border-color: #efb6b6; background: #fff8f8; }
.platform-item.stopping, .platform-item.restarting { border-color: #8ecbd3; background: #f2fbfc; }
.platform-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.platform-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.platform-copy { min-width: 0; }
.platform-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 48px;
  flex: 0 0 76px;
  overflow: hidden;
  border: 1px solid #dfe5ec;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: none;
}
.preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 10px 1fr;
  background: #f3f6f9;
}
.preview-placeholder-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  background: #dfe5ec;
}
.preview-placeholder-bar i { width: 3px; height: 3px; border-radius: 50%; background: #9ba5b4; }
.preview-placeholder-screen {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 6px 9px;
}
.preview-placeholder-screen b { display: block; height: 3px; border-radius: 999px; background: #cbd3dc; animation: preview-pulse 1.2s ease-in-out infinite; }
.preview-placeholder-screen b:nth-child(2) { width: 78%; animation-delay: .15s; }
.preview-placeholder-screen b:nth-child(3) { width: 56%; animation-delay: .3s; }
.platform-preview-image { position: relative; z-index: 2; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; background: #fff; }
.platform-preview-image[hidden] { display: none; }
.platform-preview.has-image .preview-placeholder { display: none; }
@keyframes preview-pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.platform-name { display: flex; gap: 8px; align-items: center; min-width: 0; font-weight: 900; color: #242b37; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #b7bfcc; flex: 0 0 auto; }
.platform-item.running .status-dot { background: var(--orange); box-shadow: 0 0 0 4px #fff0d7; }
.platform-item.completed .status-dot { background: var(--green); box-shadow: 0 0 0 4px #d9f8e7; }
.platform-item.skipped .status-dot { background: #7b8495; box-shadow: 0 0 0 4px #e3e7ec; }
.platform-item.error .status-dot, .platform-item.cancelled .status-dot { background: var(--red); box-shadow: 0 0 0 4px #ffe1e1; }
.platform-item.stopping .status-dot { background: var(--orange); box-shadow: 0 0 0 4px #fff0d7; }
.platform-item.restarting .status-dot { background: var(--cyan); box-shadow: 0 0 0 4px #dff6f8; }
.platform-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.platform-percent { color: #7b8495; font-size: 12px; font-weight: 900; }
.platform-cancel {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #e7a6a6;
  border-radius: 50%;
  padding: 0 0 2px;
  background: #fff;
  color: #a12d2d;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(161,45,45,.08);
}
.platform-cancel:hover:not(:disabled) { background: #ffeaea; transform: scale(1.05); }
.platform-cancel:disabled { opacity: .5; cursor: wait; transform: none; }
.platform-cancel[hidden] { display: none; }
.platform-message { margin-top: 5px; color: #6d7789; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.platform-telemetry { display: flex; align-items: center; gap: 5px; margin-top: 7px; min-width: 0; }
.platform-telemetry[hidden] { display: none; }
.platform-method-badge { display: inline-flex; align-items: center; min-height: 20px; border-radius: 999px; padding: 3px 8px; font-size: 9px; font-weight: 950; letter-spacing: .35px; white-space: nowrap; }
.platform-method-badge.neutral, .platform-method-badge.pendiente, .platform-method-badge.evaluando { background: #edf0f4; color: #687386; }
.platform-method-badge.directo, .platform-method-badge.directo_en_curso { background: #dff8e9; color: #0c6a3c; }
.platform-method-badge.directo_sesion_renovada { background: #dff6f8; color: #176b75; }
.platform-method-badge.respaldo_navegador { background: #fff0d7; color: #8a5100; }
.platform-method-badge.directo_fallido { background: #ffe5e5; color: #a12d2d; }
.platform-method-badge.omitido { background: #e5e9ef; color: #586174; }
.platform-method-time { color: #536176; font-size: 10px; font-weight: 850; white-space: nowrap; }
.platform-timing-breakdown { margin-top: 5px; max-width: 430px; color: #788397; font-size: 9px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.platform-timing-breakdown[hidden] { display: none; }
.platform-error { margin-top: 7px; color: #a12d2d; font-size: 12px; line-height: 1.35; }
.mini-progress { height: 5px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: #e8ebf0; }
.mini-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--cyan)); transition: width .3s ease; }
.platform-item.completed .mini-progress span { background: linear-gradient(90deg, var(--cyan), var(--green)); }
.platform-item.skipped .mini-progress span { background: #98a2b3; }
.platform-item.skipped .platform-message { color: #586174; font-weight: 800; }

.platform-restart {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #7fc4cc;
  border-radius: 9px;
  padding: 0;
  background: #f1fbfc;
  color: #176b75;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(23,107,117,.08);
}
.platform-restart:hover:not(:disabled) { background: #dff6f8; transform: rotate(-20deg); }
.platform-restart:disabled { opacity: .5; cursor: wait; transform: none; }
.platform-restart[hidden] { display: none; }

.platform-skip {
  min-width: 46px;
  height: 28px;
  border: 1px solid #e0ad61;
  border-radius: 9px;
  padding: 0 8px;
  background: #fff8e8;
  color: #8a5100;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(138,81,0,.08);
}
.platform-skip:hover:not(:disabled) { background: #ffedc6; transform: translateY(-1px); }
.platform-skip:disabled { opacity: .5; cursor: wait; transform: none; }
.platform-skip[hidden] { display: none; }

.platform-retry {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #e1a1a1;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  color: #982f2f;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.platform-retry:hover:not(:disabled) { background: #fff0f0; }
.platform-retry:disabled { opacity: .55; cursor: wait; }
.platform-retry[hidden] { display: none; }

.messages { margin-top: 16px; }
.message { padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.message.error { background: #ffecec; color: #8f2929; }
.message.warning { background: #fff4e4; color: #7a4a00; }
.message.success { background: #e3f8ec; color: #145e37; }

.embedded-result { margin-top: 22px; padding-top: 22px; border-top: 1px solid #d9e4de; }
.embedded-result[hidden] { display: none; }
.result-eyebrow { color: var(--green-dark); }
.result-files { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.result-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px; border: 1px solid #dfe5eb; border-radius: 15px; background: #fbfcfd; }
.result-file.ready { border-color: #b8e5c8; background: #f7fcf9; }
.result-file.processing { border-color: #f0d2a6; background: #fffaf2; }
.result-file.processing .file-icon { animation: processing-pulse 1.35s ease-in-out infinite; }
.result-file.processing .file-copy span { color: #8b5b17; font-weight: 750; }
.result-file.error { border-color: #efb6b6; background: #fff8f8; }
.file-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; color: #fff; font-weight: 950; font-size: 13px; }
.excel-icon { background: #16834b; }
.pdf-icon { background: var(--orange-dark); }
.file-copy { min-width: 0; }
.file-copy strong, .file-copy span { display: block; }
.file-copy span { margin-top: 4px; color: #727c8e; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-progress { height: 6px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #eceff3; }
.file-progress span { display: block; width: 0; height: 100%; margin: 0; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--cyan), var(--green)); transition: width .35s ease; }
.file-progress-text { display: block; margin-top: 5px; color: #7a8494; font-size: 10px; font-weight: 850; }
.file-link { border-radius: 10px; padding: 11px 14px; color: #fff; text-decoration: none; font-size: 12px; font-weight: 900; white-space: nowrap; }
.file-link.excel { background: #16834b; }
.file-link.pdf { background: var(--orange-dark); }
.file-link:hover { filter: brightness(.94); }
.result-note, .privacy { margin: 13px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.privacy { margin-top: 12px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1080px); padding-top: 16px; }
  .hero { display: block; padding: 18px; }
  .brand-lockup { align-items: flex-start; gap: 14px; }
  .brand-logo { width: 105px; }
  .version { display: inline-block; margin-top: 14px; }
  h1 { font-size: clamp(30px, 9vw, 44px); }
  .subtitle { font-size: 14px; }
  .start-form, .platform-grid, .result-files { grid-template-columns: 1fr; }
  .section-heading, .result-heading { align-items: flex-start; }
  .result-file { grid-template-columns: auto minmax(0, 1fr); }
  .file-link { grid-column: 1 / -1; text-align: center; }
}

@media (max-width: 460px) {
  .brand-lockup { display: block; }
  .platform-top { align-items: flex-start; }
  .platform-preview { width: 64px; height: 42px; flex-basis: 64px; }
  .platform-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
  .brand-logo { width: 130px; margin-bottom: 10px; }
  .action-card, .status-card { padding: 18px; }
}

@keyframes processing-pulse {
  0%, 100% { opacity: .62; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1); }
}
