/* ── Reset & Variables ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0c0c0c;
  --bg-2:      #141414;
  --bg-3:      #1c1c1c;
  --border:    #2a2a2a;
  --border-hi: #3d3d3d;
  --text:      #e8e8e8;
  --text-dim:  #666;
  --text-muted:#444;
  --accent:    #e8ff47;
  --accent-dim:#b8cc30;
  --red:       #ff4747;
  --green:     #47ff8a;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Syne', sans-serif;
  --radius:    4px;
  --transition: 150ms ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ───────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ── LOGIN ─────────────────────────────────────────────────────── */
#login-screen {
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      var(--border) 39px,
      var(--border) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      var(--border) 39px,
      var(--border) 40px
    ),
    var(--bg);
}

.login-box {
  background: var(--bg);
  border: 1px solid var(--border-hi);
  padding: 48px 40px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.4s ease both;
}

.logo {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  text-align: center;
}
.logo-bracket { color: var(--accent); }
.logo-text    { color: var(--text); }

.login-sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: -8px;
}

.input-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-hi);
}
.input-group input {
  flex: 1;
  background: var(--bg-2);
  border: none;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}
.input-group input::placeholder { color: var(--text-muted); }
.input-group button {
  background: var(--accent);
  border: none;
  color: #000;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 18px;
  transition: background var(--transition);
}
.input-group button:hover { background: var(--accent-dim); }

/* ── HEADER ────────────────────────────────────────────────────── */
#app-screen {
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-logo {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

/* ── MAIN ──────────────────────────────────────────────────────── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}

h1 {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 32px;
  color: var(--text);
}
h1::after {
  content: '_';
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

h2 {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 700;
}

/* ── FORM ──────────────────────────────────────────────────────── */
.form-section { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hint {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: none;
}

input[type="text"],
input[type="password"],
textarea,
select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
  resize: vertical;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 13px 28px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
  margin-top: 8px;
  width: fit-content;
}
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--text-dim);
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color var(--transition), color var(--transition);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── PROGRESS ──────────────────────────────────────────────────── */
.progress-section {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.job-id {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.progress-bar-wrap {
  background: var(--bg-3);
  border: 1px solid var(--border);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#progress-pct {
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
}

.status-badge {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
  border: 1px solid;
}
.status-badge.pending      { border-color: var(--text-muted); color: var(--text-muted); }
.status-badge.cutting      { border-color: #4af; color: #4af; }
.status-badge.transcribing { border-color: #a4f; color: #a4f; }
.status-badge.translating  { border-color: #fa4; color: #fa4; }
.status-badge.uploading    { border-color: #4fa; color: #4fa; }
.status-badge.done         { border-color: var(--green); color: var(--green); }
.status-badge.error        { border-color: var(--red); color: var(--red); }

/* ── LOG ───────────────────────────────────────────────────────── */
.log-area {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 16px;
  font-size: 12px;
  line-height: 1.8;
  max-height: 200px;
  overflow-y: auto;
  border-radius: var(--radius);
}
.log-line { color: var(--text-dim); }
.log-line.init { color: var(--text-muted); }
.log-line.active { color: var(--text); }
.log-line.done  { color: var(--green); }
.log-line.error { color: var(--red); }
.log-line::before { content: '> '; color: var(--text-muted); }

/* ── DONE / ERROR BLOCKS ───────────────────────────────────────── */
.done-block {
  background: rgba(71, 255, 138, 0.06);
  border: 1px solid rgba(71, 255, 138, 0.2);
  padding: 20px 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.done-block p { color: var(--green); font-weight: 700; }

.error-block {
  background: rgba(255, 71, 71, 0.06);
  border: 1px solid rgba(255, 71, 71, 0.2);
  padding: 16px 20px;
  border-radius: var(--radius);
  color: var(--red);
}

/* ── MISC ──────────────────────────────────────────────────────── */
.error-msg {
  color: var(--red);
  font-size: 12px;
}

.hidden { display: none !important; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── ANIMATIONS ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── SCROLLBAR ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .field-row { grid-template-columns: 1fr; }
  header { padding: 14px 16px; }
  main { padding: 32px 16px 60px; }
  .login-box { width: 100%; margin: 16px; padding: 32px 24px; }
}

/* ── Añadir al final de style.css ────────────────────────────────── */

/* Nav tabs */
.header-nav {
  display: flex;
  gap: 4px;
}

.nav-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.nav-tab:hover { border-color: var(--border-hi); color: var(--text); }
.nav-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* Tool sections */
.tool-section { display: flex; flex-direction: column; gap: 20px; }

/* Checkbox group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* Download group */
.download-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Secondary button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hi);
  padding: 13px 28px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color var(--transition);
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }