/* Finanzas en Pareja · estilos de las pantallas públicas (activar, gracias).
   Mismos tokens que la app: verde bosque, hueso, ámbar (persona 1) y verde (persona 2). */
:root {
  --forest: #0E5C4C; --deep: #01110D; --mid: #0A3B31;
  --bone: #FBF9EE; --bone-70: rgba(251, 249, 238, .70); --bone-45: rgba(251, 249, 238, .45); --bone-12: rgba(251, 249, 238, .12);
  --amber: #F2B547; --amber-d: #D98F1B; --teal: #3FAE8C; --teal-d: #1F7A5E;
  --danger: #F3C3BD; --danger-bg: rgba(193, 84, 75, .18); --danger-bd: rgba(224, 122, 112, .38);
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--deep); }
body.fep {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--bone); font-family: var(--sans);
  background: radial-gradient(120% 70% at 50% 0%, var(--deep) 0%, var(--mid) 58%, var(--forest) 100%) fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.wrap {
  width: 100%; max-width: 440px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: center;
}

.logo {
  display: block; width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .07);
}
h1 { margin: 0 0 8px; font: 700 32px/1.15 var(--serif); text-align: center; letter-spacing: -.01em; }
.sub { margin: 0 0 24px; color: var(--bone-70); text-align: center; font-size: 16px; line-height: 1.5; }

/* Barra de equilibrio: la firma de la app. Oscila mientras se espera. */
.bar { display: flex; gap: 0; height: 8px; margin: 0 8px 24px; border-radius: 99px; overflow: hidden; }
.bar i { display: block; flex: 1; transition: flex .6s cubic-bezier(.2, .8, .2, 1); }
.bar i:first-child { background: linear-gradient(90deg, var(--amber-d), var(--amber)); }
.bar i:last-child { background: linear-gradient(90deg, var(--teal), var(--teal-d)); }
.bar.busy i:first-child { animation: sway 1.3s ease-in-out infinite alternate; }
.bar.busy i:last-child { animation: sway 1.3s ease-in-out infinite alternate-reverse; }
@keyframes sway { from { flex: .55; } to { flex: 1.45; } }

.field { position: relative; }
.field input {
  width: 100%; height: 64px; padding: 0 84px 0 16px; border-radius: 20px; outline: 0;
  border: 1.5px solid var(--bone-12); background: rgba(1, 17, 13, .42); color: var(--bone);
  font: 600 20px/1 var(--mono); letter-spacing: .08em; text-align: center; text-transform: uppercase;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--bone-45); opacity: .55; letter-spacing: .08em; }
.field input:focus { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(242, 181, 71, .16); }
.paste {
  position: absolute; top: 8px; right: 8px; bottom: 8px; padding: 0 14px; border: 0; border-radius: 14px;
  background: var(--bone-12); color: var(--bone); font: 600 14px var(--sans); cursor: pointer;
  transition: transform .12s, background .15s;
}
.paste:active { transform: scale(.95); }
.paste[hidden] { display: none; }

.msg { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.msg.err { color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger-bd); }
.msg.info { color: var(--bone-70); background: rgba(251, 249, 238, .06); border: 1px solid var(--bone-12); }
.msg[hidden] { display: none; }

.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 12px; padding: 14px 20px;
  border-radius: 18px; cursor: pointer; font: 700 17px/1.3 var(--sans); text-align: center; text-decoration: none;
  transition: transform .12s, opacity .15s, background .15s, box-shadow .15s;
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn[hidden] { display: none; }
.btn.primary {
  border: 0; color: #1B1306; background: linear-gradient(135deg, var(--amber), var(--amber-d));
  box-shadow: 0 10px 28px rgba(217, 143, 27, .28);
}
.btn.primary:disabled { color: var(--bone-45); background: rgba(251, 249, 238, .08); box-shadow: none; cursor: not-allowed; }
.btn.outline { border: 1.5px solid rgba(242, 181, 71, .55); color: var(--amber); background: transparent; }
.btn.outline:disabled { opacity: .5; cursor: wait; }
.btn.quiet { border: 1.5px solid var(--bone-12); color: var(--bone); background: rgba(251, 249, 238, .05); }

.or { display: flex; align-items: center; gap: 12px; margin: 28px 0 4px; color: var(--bone-45); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--bone-12); }
.or[hidden] { display: none; }
.fine { margin: 10px 0 0; text-align: center; color: var(--bone-45); font-size: 13px; line-height: 1.5; }
.fine[hidden] { display: none; }
.link { display: block; margin: 14px auto 0; text-align: center; color: var(--amber); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link[hidden] { display: none; }

.help { margin-top: 24px; color: var(--bone-70); font-size: 14px; line-height: 1.55; }
.help summary { cursor: pointer; list-style: none; text-align: center; color: var(--bone-70); font-weight: 500; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: ' ›'; }
.help[open] summary::after { content: ' ⌄'; }
.help p { margin: 12px 0 0; padding: 14px; border-radius: 14px; background: rgba(251, 249, 238, .05); border: 1px solid var(--bone-12); }
.help a { color: var(--amber); }
.priv { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; color: var(--bone-45); font-size: 13px; }
.priv svg { width: 14px; height: 14px; flex: none; }

/* Aviso de modo prueba */
.ribbon {
  position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 20;
  padding: 6px 14px; border-radius: 99px; background: rgba(242, 181, 71, .16); border: 1px solid rgba(242, 181, 71, .5);
  color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.ribbon[hidden] { display: none; }

/* Pantalla de éxito / código */
.check {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(63, 174, 140, .16); border: 1.5px solid rgba(63, 174, 140, .55); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1);
}
.check svg { width: 34px; height: 34px; stroke: var(--teal); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.codecard {
  margin: 4px 0 0; padding: 18px 16px 16px; border-radius: 22px; text-align: center;
  background: linear-gradient(160deg, rgba(251, 249, 238, .10), rgba(251, 249, 238, .04));
  border: 1px solid rgba(242, 181, 71, .32); box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
}
.codecard small { display: block; color: var(--bone-45); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.codecard output { display: block; margin: 10px 0 14px; color: var(--amber); font: 700 28px/1 var(--mono); letter-spacing: .1em; user-select: all; }
.codecard .btn { min-height: 44px; padding: 10px 16px; margin-top: 0; font-size: 15px; border-radius: 14px; }
.steps { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; margin: 0 0 12px; padding-left: 36px; color: var(--bone-70); font-size: 14px; line-height: 1.5; }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bone-12); color: var(--bone); font-size: 12px; font-weight: 700;
}
.steps b { color: var(--bone); font-weight: 600; }
.center { text-align: center; }

/* Hoja inferior (reemplaza los diálogos nativos del navegador) */
.scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(1, 17, 13, .66); animation: fade .18s ease; }
.sheet {
  width: 100%; max-width: 480px; padding: 12px 24px max(24px, env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  background: #0B2F28; border: 1px solid var(--bone-12); border-bottom: 0; animation: up .24s cubic-bezier(.2, .9, .3, 1);
}
.sheet::before { content: ''; display: block; width: 40px; height: 4px; margin: 0 auto 18px; border-radius: 4px; background: var(--bone-12); }
.sheet h2 { margin: 0 0 8px; font: 700 22px/1.2 var(--serif); }
.sheet p { margin: 0 0 6px; color: var(--bone-70); font-size: 15px; line-height: 1.55; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 18px; border-radius: 99px; background: #0B2F28; border: 1px solid rgba(242, 181, 71, .4); color: var(--bone);
  font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: all .25s; pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
