/* ===========================================================
   Team Randazzo — Portal de clientes (ingresar.html + mi-panel.html)
   Pensado para celular y para gente mayor: letra grande, botones grandes.
   Se carga después de styles.css y app.css.
=========================================================== */

.portal-body{ background: var(--bg); min-height: 100vh; }
.portal-body .app-top .wrap{ height: 64px; }
button.link-quiet{ font-size: 15px; min-height: 44px; padding: 0 6px; }

/* ---------- Animaciones ---------- */
@keyframes p-rise{ from{ opacity: 0; transform: translateY(14px); } to{ opacity: 1; transform: none; } }
@keyframes p-float{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-6px); } }
@keyframes p-grow{ from{ transform: scaleX(0); } to{ transform: scaleX(1); } }
@keyframes p-ping{ 0%{ box-shadow: 0 0 0 0 var(--primary-a45); } 80%,100%{ box-shadow: 0 0 0 12px var(--primary-a00); } }
@keyframes p-shine{ 0%{ background-position: -220px 0; } 100%{ background-position: 520px 0; } }
@keyframes p-pop{ 0%{ transform: scale(.4) rotate(-12deg); opacity: 0; } 60%{ transform: scale(1.12) rotate(4deg); opacity: 1; } 100%{ transform: scale(1); } }
@keyframes p-fall{ 0%{ transform: translateY(-40px) rotate(0); opacity: 0; } 10%{ opacity: 1; } 100%{ transform: translateY(110vh) rotate(540deg); opacity: 1; } }
@keyframes p-halo{ 0%,100%{ transform: scale(1); opacity: .35; } 50%{ transform: scale(1.15); opacity: .15; } }
@keyframes p-sheet{ from{ transform: translateY(40px); opacity: 0; } to{ transform: none; opacity: 1; } }
@keyframes p-fade{ from{ opacity: 0; } to{ opacity: 1; } }
@keyframes p-sk{ 0%{ background-position: 100% 0; } 100%{ background-position: -100% 0; } }

.rise{ animation: p-rise .6s cubic-bezier(.2,.7,.2,1) both; }
.float{ animation: p-float 4s ease-in-out infinite; }
.ping{ animation: p-ping 2s ease-out infinite; }
@media (prefers-reduced-motion: reduce){
  .rise, .float, .ping, .shine, .bar-in, .ring-in, .celebrate *, .p-sheet[open]{ animation: none !important; }
  .celebrate .conf{ display: none; }
}

/* ---------- Ingreso ---------- */
.login{ display: flex; justify-content: center; padding: 36px 20px 40px; }
.login-card{ width: 100%; max-width: 440px; display: flex; flex-direction: column; }
.login-icon{ width: 56px; height: 56px; border-radius: 50%; background: var(--secondary-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-card .eyebrow{ color: var(--primary); margin-bottom: 12px; }
.login-card h1{ font-size: 36px; line-height: 1.1; font-weight: 400; }
.login-card .lead{ margin-top: 12px; font-size: 16.5px; line-height: 1.55; color: var(--ink-soft); }
.login-form{ margin-top: 28px; display: flex; flex-direction: column; gap: 20px; animation-delay: .08s; }
.big-field{ display: flex; flex-direction: column; gap: 8px; }
.big-field > span{ font-size: 15.5px; font-weight: 500; }
.big-field input{
  height: 58px; padding: 0 16px; border: 1px solid #D9D2C7; border-radius: 12px; background: var(--white);
  font: inherit; font-size: 20px; letter-spacing: .05em; color: var(--ink); width: 100%;
}
.big-field input.is-code{ font-size: 24px; letter-spacing: .5em; }
.big-field input:focus{ outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px var(--secondary-a15); }
.big-field small{ font-size: 13.5px; color: var(--ink-soft); }
.btn-big{
  height: 58px; border-radius: 14px; background: var(--primary); color: var(--on-primary); width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 17px; border: 0; cursor: pointer; text-decoration: none;
  padding: 0 18px; text-align: center; line-height: 1.25;
  transition: background .15s ease, transform .15s ease;
}
.btn-big:hover{ background: var(--primary-dark); color: var(--on-primary); }
.btn-big:active{ transform: scale(.99); }
.btn-big[disabled]{ opacity: .6; }
.btn-big:focus-visible{ outline: 3px solid var(--primary-light); outline-offset: 3px; }
.btn-big svg{ flex-shrink: 0; }
.btn-big.is-light{ background: var(--white); color: var(--secondary); }
.btn-big.is-outline{ background: var(--white); color: var(--ink); border: 1px solid #D9D2C7; height: 54px; font-weight: 500; font-size: 16px; }
.btn-big.is-outline:hover{ border-color: var(--ink); }
.login .form-msg{ font-size: 15px; border-radius: 10px; }
.help-card{
  margin-top: 32px; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px;
  background: var(--white); border: 1px solid var(--line); color: var(--ink); font-size: 14.5px; line-height: 1.45; animation-delay: .16s;
}
.help-card b{ color: var(--primary); }
.help-card:hover{ color: var(--ink); border-color: #D0C8BC; }
.help{ margin-top: 32px; display: flex; flex-direction: column; gap: 12px; animation-delay: .16s; }
.help .help-card{ margin-top: 0; }
.join-card{ background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 8px; }
.join-title{ font-size: 15.5px; font-weight: 600; color: var(--ink); }
.join-sub{ margin-top: 2px; font-size: 14px; color: var(--ink-soft); }
.join-people{ margin-top: 8px; display: flex; flex-direction: column; }
.join-person{ display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; color: var(--ink); border-top: 1px solid var(--line); }
.join-person:first-child{ border-top: 0; }
.join-person img{ width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #EFEAE2; flex-shrink: 0; }
.join-person span{ flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.join-person b{ font-weight: 500; font-size: 15px; }
.join-person small{ font-size: 13px; color: var(--primary); font-weight: 500; }
.join-person svg{ color: var(--ink-soft); flex-shrink: 0; }
.join-person:hover{ color: var(--ink); }
.join-person:hover svg{ color: var(--ink); }

/* ---------- Panel del cliente ---------- */
.portal{ max-width: 560px; margin: 0 auto; padding: 24px 16px 130px; display: flex; flex-direction: column; gap: 18px; }
.sk{ border-radius: 18px; background: linear-gradient(90deg, #EFEAE2 0%, #F7F3EE 50%, #EFEAE2 100%); background-size: 200% 100%; animation: p-sk 1.2s ease-in-out infinite; }

.hello{ padding: 0 4px; }
.hello h1{ font-size: 34px; line-height: 1.1; font-weight: 400; }
.hello p{ margin-top: 6px; font-size: 16px; color: var(--ink-soft); line-height: 1.5; }

.score{
  background: var(--secondary); color: var(--on-secondary); border-radius: 22px; padding: 26px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; animation-delay: .06s;
}
.ring{ position: relative; width: 180px; height: 180px; }
.ring svg{ display: block; }
.ring .ring-in{ transition: stroke-dashoffset 1.6s cubic-bezier(.2,.7,.2,1); }
.ring-center{ position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b{ font-family: var(--font-display); font-weight: 400; font-size: 46px; line-height: 1; }
.ring-center span{ font-size: 12px; letter-spacing: .14em; color: var(--secondary-light); margin-top: 4px; }
.score .next{ font-size: 16.5px; line-height: 1.45; }
.score .next em{ display: block; font-style: normal; font-family: var(--font-display); font-size: 24px; margin-top: 2px; }
.score .sub{ font-size: 14px; color: var(--secondary-light); }

.p-card{ background: var(--white); border-radius: 18px; padding: 20px 18px; display: flex; flex-direction: column; }
.p-card h2{ font-size: 24px; font-weight: 400; margin-bottom: 12px; }
.p-card .head{ display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.p-card .head h2{ margin: 0; }

/* Camino de premios */
.step{ display: flex; gap: 14px; }
.step .rail{ display: flex; flex-direction: column; align-items: center; }
.step .dot{
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.step .line{ width: 2px; flex-grow: 1; min-height: 18px; background: #E4DED5; }
.step .body{ padding-bottom: 20px; flex: 1; min-width: 0; }
.step:last-child .body{ padding-bottom: 0; }
.step .lvl{ font-size: 12px; letter-spacing: .1em; color: var(--ink-soft); }
.step .name{ font-size: 17.5px; font-weight: 600; margin-top: 2px; }
.step .desc{ font-size: 14.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.step.is-done .dot{ background: var(--secondary); color: var(--on-secondary); }
.step.is-done .line{ background: var(--secondary); }
.step.is-won .dot{ background: var(--primary); color: var(--on-primary); }
.step.is-won .line{ background: linear-gradient(var(--primary), #E4DED5); }
.step.is-next .dot{ background: var(--white); border: 2px solid var(--secondary); color: var(--secondary); }
.step.is-next .lvl{ color: var(--secondary); font-weight: 600; }
.step.is-locked .dot{ background: var(--white); border: 2px dashed #D0C8BC; }
.step.is-locked .name{ color: var(--ink-soft); }
.step.is-locked .desc, .step.is-locked .lvl{ color: var(--muted); }
.tag-ok{ display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: #1F6B3A; background: #E8F4EC; padding: 4px 10px; border-radius: 10px; }
.won-note{ margin-top: 8px; font-size: 14px; color: var(--primary-dark); background: var(--primary-soft); padding: 10px 12px; border-radius: 10px; line-height: 1.45; }
.mini-bar{ margin-top: 10px; height: 8px; border-radius: 4px; background: var(--secondary-soft); overflow: hidden; }
.mini-bar i{ display: block; height: 100%; border-radius: 4px; background: var(--secondary); }
.bar-in{ transform-origin: left; animation: p-grow 1.2s cubic-bezier(.2,.7,.2,1) .5s both; }
.mini-txt{ margin-top: 6px; font-size: 13.5px; color: var(--ink-soft); }

/* Gran premio */
.grand{
  background-color: var(--ink); color: var(--white); border-radius: 18px; padding: 22px 20px;
  display: flex; flex-direction: column; gap: 8px; overflow: hidden;
}
.grand small{ font-size: 12px; letter-spacing: .16em; color: var(--primary-light); font-weight: 500; }
.grand h2{ font-size: 26px; line-height: 1.15; font-weight: 400; color: var(--white); }
.grand p{ font-size: 15px; line-height: 1.55; color: #D9D4CC; }
.shine{ background-image: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%); background-size: 220px 100%; background-repeat: no-repeat; animation: p-shine 3.4s ease-in-out infinite; }

/* Mensajes */
.badge-new{ font-size: 12px; font-weight: 600; color: var(--on-primary); background: var(--primary); padding: 3px 9px; border-radius: 10px; }
.msg{ padding: 12px 0; border-top: 1px solid #F1ECE4; display: flex; flex-direction: column; gap: 4px; }
.msg:first-of-type{ border-top: 0; padding-top: 0; }
.msg.is-new{ border-left: 3px solid var(--primary); padding-left: 14px; border-top: 0; }
.msg .meta{ font-size: 13px; color: var(--ink-soft); }
.msg .meta b{ color: var(--ink); }
.msg .txt{ font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; }
.more-btn{ margin-top: 6px; align-self: flex-start; min-height: 44px; font-size: 14.5px; color: var(--primary); padding: 0; }

/* Personas recomendadas */
.person{ display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #F1ECE4; }
.person:first-of-type{ border-top: 0; }
.person .av{ width: 40px; height: 40px; border-radius: 50%; background: var(--secondary-soft); color: var(--secondary); display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 600; flex-shrink: 0; }
.person .nm{ flex: 1; font-size: 16.5px; }
.person .pts{ font-size: 13.5px; color: #1F6B3A; font-weight: 600; }
.empty-soft{ font-size: 15px; color: var(--ink-soft); line-height: 1.55; }

details.how{ background: var(--white); border-radius: 18px; padding: 4px 18px; }
details.how summary{ min-height: 58px; display: flex; align-items: center; justify-content: space-between; font-size: 16.5px; font-weight: 600; cursor: pointer; list-style: none; }
details.how summary::-webkit-details-marker{ display: none; }
details.how summary svg{ transition: transform .25s ease; }
details.how[open] summary svg{ transform: rotate(180deg); }
details.how p{ font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); padding-bottom: 18px; }

/* Botón fijo abajo */
.cta-bar{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(250,248,245,0), var(--bg) 40%);
}
.cta-bar[hidden]{ display: none; }
.cta-bar .btn-big{ max-width: 528px; margin: 0 auto; box-shadow: 0 10px 28px var(--primary-a30); }

/* Hoja "Recomendar" */
.p-sheet{
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  border-radius: 24px 24px 0 0; background: var(--white); color: var(--ink); overflow: auto;
}
.p-sheet[open]{ animation: p-sheet .35s cubic-bezier(.2,.7,.2,1) both; }
.p-sheet::backdrop{ background: rgba(33,30,27,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: p-fade .25s ease both; }
@media (min-width: 700px){ .p-sheet{ margin: auto; border-radius: 20px; } }
.p-sheet .inner{ padding: 10px 22px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }
.p-sheet .grip{ width: 40px; height: 4px; border-radius: 2px; background: #D9D2C7; align-self: center; }
.p-sheet .top{ display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.p-sheet .top small{ display: block; font-size: 12px; letter-spacing: .16em; font-weight: 500; color: var(--primary); margin-bottom: 6px; }
.p-sheet h2{ font-size: 30px; line-height: 1.12; font-weight: 400; }
.x-btn{ width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 10px; color: var(--ink); }
.x-btn:hover{ background: var(--bg-alt); }
.steps3{ display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps3 li{ display: flex; gap: 14px; align-items: flex-start; font-size: 16px; line-height: 1.5; }
.steps3 li > span:first-child{ width: 30px; height: 30px; border-radius: 50%; background: var(--secondary-soft); color: var(--secondary); font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: -2px; }
.steps3 li:last-child > span:first-child{ background: var(--primary-soft); color: var(--primary); }
.agent{ display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--bg); }
.agent img{ width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.agent div{ font-size: 15px; line-height: 1.4; }
.agent small{ color: var(--ink-soft); font-size: 13.5px; }
.sheet-actions{ display: flex; flex-direction: column; gap: 10px; }

/* Festejo de premio */
.celebrate{
  position: fixed; inset: 0; z-index: 100; background: var(--secondary); color: var(--on-secondary); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 40px 28px calc(40px + env(safe-area-inset-bottom)); animation: p-fade .3s ease both;
}
.celebrate[hidden]{ display: none; }
.celebrate .conf{ position: absolute; top: 0; width: 8px; height: 14px; border-radius: 2px; animation: p-fall 3.6s linear infinite; }
.celebrate .gift{ position: relative; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; margin-bottom: 28px; }
.celebrate .halo{ position: absolute; inset: 0; border-radius: 50%; background: var(--white); animation: p-halo 2.4s ease-in-out infinite; }
.celebrate .disc{ width: 112px; height: 112px; border-radius: 50%; background: var(--white); display: flex; align-items: center; justify-content: center; position: relative; animation: p-pop .8s cubic-bezier(.2,.7,.2,1) .2s both; }
.celebrate small{ font-size: 12px; letter-spacing: .18em; color: var(--secondary-light); }
.celebrate h1{ margin-top: 10px; font-size: 40px; line-height: 1.08; font-weight: 400; color: var(--on-secondary); max-width: 420px; }
.celebrate p{ margin-top: 14px; font-size: 16.5px; line-height: 1.55; color: var(--secondary-soft-2); max-width: 400px; }
.celebrate p.small{ font-size: 15px; color: var(--secondary-light); }
.celebrate .btn-big{ margin-top: 36px; max-width: 400px; }
.celebrate > *:not(.conf){ position: relative; z-index: 1; }

@media (min-width: 700px){
  .portal{ padding-top: 40px; }
  .hello h1{ font-size: 40px; }
}
