/* ============================================================
   ESTILOS DEL TRADUCTOR ESPAÑOL – MOCOVÍ
   ============================================================ */

:root {
  --bg:           #faf9f7;
  --surface:      #ffffff;
  --border:       #e8e5df;
  --border-strong:#c8c4bc;
  --text:         #1a1916;
  --text-2:       #6b6860;
  --text-hint:    #a8a49e;
  --accent:       #3d2c8a;
  --accent-light: #eeecfd;
  --accent-mid:   #b0a8e8;
  --accent-dark:  #2a1d65;
  --success:      #1a6b3d;
  --radius:       10px;
  --radius-sm:    6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #141312;
    --surface:      #1e1d1b;
    --border:       #2e2c28;
    --border-strong:#4a4740;
    --text:         #f0ede8;
    --text-2:       #9e9b94;
    --text-hint:    #5c5950;
    --accent:       #a09ae0;
    --accent-light: #1e1b3a;
    --accent-mid:   #534ab7;
    --accent-dark:  #c8c2f0;
    --success:      #5dcaa5;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 16px;
}

/* ---- Header ---- */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-mark {
  width: 42px;
  height: 42px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
header h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
header p {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ---- Main ---- */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ---- Selector de idioma ---- */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
}
.lang-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all .15s;
}
.lang-btn.active {
  background: var(--accent-light);
  border-color: var(--accent-mid);
  color: var(--accent-dark);
}
.lang-btn:hover:not(.active) {
  background: var(--bg);
}
.swap-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  font-family: inherit;
  transition: background .15s;
}
.swap-btn:hover { background: var(--bg); }

/* ---- Ejemplos ---- */
.examples-label {
  font-size: 12px;
  color: var(--text-hint);
  margin-bottom: 6px;
}
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.25rem;
}
.ex-pill {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ex-pill:hover {
  border-color: var(--accent-mid);
  color: var(--accent-dark);
  background: var(--accent-light);
}

/* ---- Paneles ---- */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 560px) {
  .panels { grid-template-columns: 1fr; }
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.panel-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.panel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ---- Botón de voz ---- */
.speak-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.speak-btn:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent-mid);
}
.speak-btn:disabled { opacity: .35; cursor: not-allowed; }
.speak-btn.speaking {
  background: var(--accent-mid);
  border-color: var(--accent-mid);
  color: #fff;
  animation: pulse-speak 1s ease-in-out infinite;
}
@keyframes pulse-speak {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* ---- Selector de voz ---- */
.voice-row {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.1rem;
  font-size: 13px;
  color: var(--text-2);
}
#voice-select {
  flex: 1;
  max-width: 320px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 110px;
  line-height: 1.65;
}
textarea::placeholder { color: var(--text-hint); }

.result-box {
  min-height: 110px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}
.result-placeholder {
  color: var(--text-hint);
  font-style: italic;
}

/* ---- Loading ---- */
.loading {
  color: var(--text-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Botones ---- */
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
button:hover { background: var(--bg); }
button:active { transform: scale(.98); }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
button.primary {
  background: var(--accent-light);
  border-color: var(--accent-mid);
  color: var(--accent-dark);
  font-weight: 500;
}
button.primary:hover {
  background: var(--accent-mid);
  color: #fff;
}

/* ---- Nota ---- */
.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-mid);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}
.note strong { color: var(--text); }

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 12px;
  color: var(--text-hint);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
