/* ===============================================================
   ikou.app — Design tokens compartidos
   Estética iOS 26 liquid glass, misma paleta que V1
   =============================================================== */

:root {
  --bg-1: #0a0a14;
  --bg-2: #1a0f2e;
  --bg-3: #2a1248;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, .62);
  --text-faint: rgba(255, 255, 255, .38);
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(255, 255, 255, .10);
  --stroke: rgba(255, 255, 255, .12);
  --stroke-strong: rgba(255, 255, 255, .22);
  --accent: #7c8cff;
  --accent-2: #ff7eb3;
  --accent-gradient: linear-gradient(135deg, #ff6ec4, #7873f5);
  --success: #5ee5a1;
  --warning: #ffd166;
  --danger: #ff6b6b;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-1: #f5f3ff;
    --bg-2: #fde4f2;
    --bg-3: #e3eaff;
    --text: #0c0c14;
    --text-dim: rgba(12, 12, 20, .62);
    --text-faint: rgba(12, 12, 20, .38);
    --glass: rgba(255, 255, 255, .55);
    --glass-strong: rgba(255, 255, 255, .75);
    --stroke: rgba(12, 12, 20, .08);
    --stroke-strong: rgba(12, 12, 20, .16);
  }
}
/* Override manual del usuario — gana sobre el media query */
:root[data-theme="light"] {
  --bg-1: #f5f3ff;
  --bg-2: #fde4f2;
  --bg-3: #e3eaff;
  --text: #0c0c14;
  --text-dim: rgba(12, 12, 20, .62);
  --text-faint: rgba(12, 12, 20, .38);
  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .75);
  --stroke: rgba(12, 12, 20, .08);
  --stroke-strong: rgba(12, 12, 20, .16);
}
:root[data-theme="dark"] {
  --bg-1: #0a0a14;
  --bg-2: #1a0f2e;
  --bg-3: #2a1248;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, .62);
  --text-faint: rgba(255, 255, 255, .38);
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(255, 255, 255, .10);
  --stroke: rgba(255, 255, 255, .12);
  --stroke-strong: rgba(255, 255, 255, .22);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  background: var(--bg-1);
  color-scheme: dark light;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% -10%, var(--bg-3) 0%, transparent 60%),
    radial-gradient(900px 700px at 110% 20%, var(--bg-2) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-1));
  min-height: 100dvh;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  pointer-events: none;
  z-index: -1;
}
.orb.a { width: 42vmax; height: 42vmax; max-width: 520px; max-height: 520px; background: #ff6ec4; top: -12vmax; right: -12vmax; }
.orb.b { width: 38vmax; height: 38vmax; max-width: 480px; max-height: 480px; background: #7873f5; bottom: -12vmax; left: -12vmax; }
@media (prefers-color-scheme: light) { .orb { opacity: .4; } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid var(--stroke);
  background: var(--glass-strong);
  color: var(--text);
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { background: rgba(255, 255, 255, .14); }
.btn:active { transform: scale(.98); }

.btn.primary {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(120, 115, 245, .35);
}
.btn.primary:hover { box-shadow: 0 10px 28px rgba(120, 115, 245, .45); }

.btn.ghost {
  background: transparent;
}

.btn.danger-btn {
  background: rgba(255, 107, 107, .08);
  border-color: rgba(255, 107, 107, .35);
  color: #ff8a8a;
}
.btn.danger-btn:hover { background: rgba(255, 107, 107, .16); border-color: rgba(255, 107, 107, .55); color: #ffb0b0 }

.btn:disabled, .btn[disabled] {
  opacity: .5; cursor: not-allowed; pointer-events: none;
}

.btn.icon-only { padding: 7px 10px }
.btn svg { flex-shrink: 0 }

.btn:focus-visible, .icon-btn:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Cards */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 20px;
  padding: 20px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 40%);
}

/* Inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding-left: 4px;
}
.field input, .field textarea, .field select {
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 13px 16px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  outline: 0;
  letter-spacing: -0.01em;
  transition: border-color .2s ease, background .2s ease;
  width: 100%;
}
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'><path d='M1 1l5 5 5-5' fill='none' stroke='rgba(255,255,255,.55)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
@media (prefers-color-scheme: light) {
  .field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'><path d='M1 1l5 5 5-5' fill='none' stroke='rgba(12,12,20,.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  }
}
:root[data-theme="light"] .field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'><path d='M1 1l5 5 5-5' fill='none' stroke='rgba(12,12,20,.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
:root[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'><path d='M1 1l5 5 5-5' fill='none' stroke='rgba(255,255,255,.55)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--stroke-strong);
  background: rgba(255, 255, 255, .12);
}

/* Error / info messages */
.msg {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.msg.error { background: rgba(255, 107, 107, .12); border: 1px solid rgba(255, 107, 107, .28); color: #ffb0b0; }
.msg.success { background: rgba(94, 229, 161, .10); border: 1px solid rgba(94, 229, 161, .28); color: #90efb5; }
.msg.info { background: rgba(120, 115, 245, .10); border: 1px solid rgba(120, 115, 245, .3); color: #bdc6ff; }

/* Utility */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.center { text-align: center; }
.hidden { display: none !important; }
