/* Base visual compartida — inspirada en el lenguaje de Apple */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link: #0066cc;
  --green: #1d8a3a;
  --red: #e30000;
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.28,.11,.32,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html { background: var(--bg); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* Barra superior translúcida */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: 52px;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.nav-inner {
  max-width: 1024px; height: 100%; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-weight: 600; font-size: 21px; letter-spacing: -0.02em; color: var(--text); }
.brand sup { font-size: .45em; font-weight: 500; vertical-align: super; margin-left: 1px; }
.nav-meta { font-size: 12px; color: var(--text-2); letter-spacing: -0.01em; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 980px;
  font-size: 17px; font-weight: 400; letter-spacing: -0.022em;
  transition: background .2s var(--ease), transform .2s var(--ease), opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-dark { background: var(--text); color: #fff; }
.btn-secondary { background: var(--bg-alt); color: var(--text); }
.btn-secondary:hover { background: #ebebf0; }
.btn-ghost { color: var(--link); padding: 0 8px; min-height: 36px; }
.btn-ghost:hover { text-decoration: underline; }
.btn-sm { min-height: 34px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link-arrow::after { content: " ›"; font-size: 1.15em; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0; text-transform: uppercase; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff;
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.15); }

/* Revelado al hacer scroll */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Spinner */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(0,0,0,.12); border-top-color: var(--text-2); animation: spin .8s linear infinite; }
.btn-primary .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; width: 18px; height: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: rgba(29,29,31,.92); color: #fff; padding: 12px 20px; border-radius: 14px;
  font-size: 15px; opacity: 0; pointer-events: none; transition: all .35s var(--ease); z-index: 200;
  backdrop-filter: blur(10px); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Hoja modal */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .3s var(--ease);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  background: #fff; border-radius: var(--radius-xl); width: 100%; max-width: 460px;
  padding: 36px 32px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.25);
  transform: scale(.94) translateY(12px); transition: transform .35s var(--ease);
  max-height: calc(100vh - 32px); overflow: auto;
}
.sheet-backdrop.open .sheet { transform: none; }

.demo-banner a { color: inherit; text-decoration: underline; }
.demo-banner {
  background: #fff7e0; color: #7a5b00; font-size: 13px; text-align: center; padding: 8px 16px;
}
