:root {
  --blue:#0C4375; --blue-deep:#06182a; --yellow:#EAB308;
  --text:#f8fafc; --muted:#c5d0dc; --glass:rgba(7,18,31,.67);
  --border:rgba(255,255,255,.22);
}
* { box-sizing:border-box; }
html { min-height:100%; width:100%; overflow-x:hidden; }
body {
  margin:0; min-height:100vh; min-height:100dvh; width:100%; max-width:100%;
  color:var(--text); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:#06101b; overflow-x:hidden; overscroll-behavior-x:none;
}
button,input { font:inherit; }
button { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.background {
  position:fixed; inset:0; z-index:-3; width:100%; height:100%;
  background:linear-gradient(115deg,rgba(2,10,19,.82),rgba(12,67,117,.55) 48%,rgba(2,8,16,.78)),
    url("../img/fondo-iglesia.jpg") center/cover no-repeat,
    linear-gradient(135deg,#06182a,#0C4375 55%,#111827);
  pointer-events:none;
}
.background::after { content:""; position:absolute; inset:0; background:radial-gradient(ellipse at 50% 30%,transparent 0%,rgba(0,0,0,.28) 70%,rgba(0,0,0,.58) 100%); }
.ambient { position:fixed; z-index:-2; width:min(32rem,90vw); height:min(32rem,90vw); border-radius:50%; filter:blur(100px); opacity:.2; pointer-events:none; animation:float 12s ease-in-out infinite alternate; }
.ambient-one { background:#0C4375; top:-12rem; left:-10rem; }
.ambient-two { background:#EAB308; bottom:-18rem; right:-10rem; animation-delay:-5s; opacity:.12; }
.page-shell { width:100%; max-width:100vw; min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; justify-content:center; align-items:center; padding:32px 16px 18px; overflow-x:clip; }
.glass-card {
  width:min(100%,470px); min-width:0; position:relative; overflow:hidden;
  padding:32px 34px 20px; border:1px solid var(--border); border-radius:28px;
  background:linear-gradient(145deg,rgba(255,255,255,.12),var(--glass) 36%,rgba(3,12,22,.64));
  box-shadow:0 28px 90px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.13);
  -webkit-backdrop-filter:blur(22px); backdrop-filter:blur(22px);
  animation:card-in .75s cubic-bezier(.2,.75,.25,1) both;
}
.glass-card::before { content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; pointer-events:none; background:linear-gradient(135deg,rgba(255,255,255,.42),transparent 30%,rgba(234,179,8,.23) 75%,transparent); -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); -webkit-mask-composite:xor; mask-composite:exclude; }
.card-glow { position:absolute; top:-100px; left:20%; width:60%; height:180px; background:rgba(234,179,8,.12); filter:blur(55px); pointer-events:none; }
.brand,.form-view,.card-footer { position:relative; z-index:1; }
.brand { text-align:center; margin-bottom:25px; }
.logo-frame { width:76px; height:76px; margin:0 auto 16px; border-radius:23px; display:grid; place-items:center; background:linear-gradient(145deg,rgba(255,255,255,.2),rgba(255,255,255,.04)); border:1px solid rgba(255,255,255,.28); box-shadow:0 8px 30px rgba(0,0,0,.18),0 0 24px rgba(234,179,8,.09); overflow:hidden; }
.logo { width:100%; height:100%; object-fit:contain; padding:8px; }
.logo-fallback { display:none; width:100%; height:100%; place-items:center; color:var(--yellow); font-size:24px; font-weight:800; letter-spacing:-2px; }
.eyebrow { margin:0 0 8px; color:var(--yellow); font-size:10px; font-weight:800; letter-spacing:2.5px; }
h1 { margin:0; font-size:clamp(25px,5vw,31px); line-height:1.15; letter-spacing:-.9px; font-weight:750; }
.subtitle { color:var(--muted); font-size:13px; line-height:1.65; margin:12px auto 0; max-width:330px; }
form { display:flex; flex-direction:column; gap:8px; }
label { margin-top:7px; color:#edf3f9; font-size:12px; font-weight:650; }
.input-wrap { min-height:51px; min-width:0; width:100%; display:flex; align-items:center; gap:12px; padding:0 13px; border:1px solid rgba(255,255,255,.17); border-radius:13px; background:rgba(2,11,21,.37); transition:border-color .2s,box-shadow .2s,background .2s; }
.input-wrap:focus-within { border-color:rgba(234,179,8,.8); box-shadow:0 0 0 3px rgba(234,179,8,.10); background:rgba(2,11,21,.54); }
.input-wrap>svg { flex:0 0 19px; width:19px; height:19px; fill:none; stroke:#eab308; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; opacity:.95; }
.input-wrap input { width:100%; min-width:0; max-width:100%; color:white; border:0; outline:0; background:transparent; padding:13px 0; font-size:16px; line-height:1.35; appearance:none; }
.input-wrap input::placeholder { color:#91a0b0; opacity:1; }
.password-wrap input { padding-right:2px; }
.eye-button { flex:0 0 32px; width:32px; height:36px; display:grid; place-items:center; color:#c5d0dc; border:0; border-radius:8px; background:transparent; cursor:pointer; }
.eye-button:hover,.eye-button:focus-visible { color:var(--yellow); background:rgba(255,255,255,.08); outline:0; }
.eye-button svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.key-visual { display:flex; justify-content:center; gap:7px; height:0; opacity:0; overflow:hidden; transform:translateY(-3px); transition:height .22s,opacity .22s,transform .22s; pointer-events:none; }
.key-visual.is-active { height:13px; opacity:1; transform:translateY(0); margin:1px 0 2px; }
.key-visual span { display:block; width:7px; height:7px; border-radius:2px; border:1px solid rgba(234,179,8,.42); background:rgba(234,179,8,.08); transform:rotate(45deg); transition:background .2s,border-color .2s,box-shadow .2s,transform .2s; }
.key-visual span.filled { background:var(--yellow); border-color:#ffe58a; box-shadow:0 0 11px rgba(234,179,8,.5); transform:rotate(0) scale(1.12); animation:key-pop .35s ease both; }
.key-visual span.current { animation:key-float 1.2s ease-in-out infinite; }
.primary-button,.secondary-button { min-height:50px; width:100%; min-width:0; display:flex; justify-content:center; align-items:center; gap:10px; border-radius:13px; padding:12px 16px; text-decoration:none; font-size:13px; font-weight:750; cursor:pointer; transition:transform .2s,box-shadow .2s,background .2s,border-color .2s; }
.primary-button { margin-top:14px; border:1px solid rgba(255,225,112,.62); color:#17202b; background:linear-gradient(110deg,#f5d24d,#EAB308 58%,#d49a00); box-shadow:0 9px 24px rgba(234,179,8,.17),inset 0 1px 0 rgba(255,255,255,.45); }
.primary-button:hover { transform:translateY(-2px); box-shadow:0 13px 28px rgba(234,179,8,.25); }
.primary-button:active,.secondary-button:active { transform:scale(.985); }
.primary-button:disabled { opacity:.65; cursor:wait; transform:none; }
.button-arrow { font-size:19px; line-height:1; margin-left:auto; }
.separator { display:flex; align-items:center; gap:12px; margin:20px 0 13px; color:#aab6c4; font-size:11px; }
.separator::before,.separator::after { content:""; flex:1; height:1px; background:rgba(255,255,255,.14); }
.secondary-button { margin:0; color:#f5f8fc; background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.22); }
.secondary-button:hover { background:rgba(255,255,255,.11); border-color:rgba(234,179,8,.5); }
.plus-icon { display:grid; place-items:center; width:22px; height:22px; border-radius:7px; color:var(--yellow); border:1px solid rgba(234,179,8,.4); font-size:18px; }
.privacy-note { display:flex; justify-content:center; align-items:center; gap:8px; color:#9fadb9; font-size:10px; margin:17px 0 4px; text-align:center; }
.secure-dot { width:6px; height:6px; flex:0 0 6px; border-radius:50%; background:#4ade80; box-shadow:0 0 10px rgba(74,222,128,.6); }
.card-footer { display:flex; align-items:center; justify-content:center; gap:0; margin-top:20px; color:rgba(223,232,241,.62); font-size:9px; letter-spacing:1.7px; text-align:center; }
.card-footer>span:first-child { display:block; width:100%; text-align:center; }
.footer-line { display:none; }
.register-heading { display:flex; align-items:center; gap:13px; margin:0 0 5px; }
.register-heading h2 { margin:0; font-size:25px; letter-spacing:-.6px; }
.back-button { width:39px; height:39px; flex:0 0 39px; border:1px solid rgba(255,255,255,.2); border-radius:12px; background:rgba(255,255,255,.07); color:white; font-size:24px; cursor:pointer; }
.register-copy { color:var(--muted); font-size:12px; line-height:1.5; margin:7px 0 13px; }
#register-view .input-wrap { min-height:45px; }
#register-view .input-wrap input { padding-top:10px; padding-bottom:10px; }
#register-view form { gap:5px; }
#register-view label { margin-top:4px; }
#register-view .primary-button { margin-top:11px; }
#register-view .privacy-note { margin-top:12px; }
.glass-card.register-mode .brand { margin-bottom:18px; }
.glass-card.register-mode .brand-eyebrow,.glass-card.register-mode .brand-title,.glass-card.register-mode .brand-subtitle { display:none; }
.glass-card.register-mode .logo-frame { margin-bottom:0; width:62px; height:62px; border-radius:19px; }
.glass-card.register-mode .card-footer { margin-top:15px; }
.page-caption { margin:14px 0 0; color:rgba(255,255,255,.76); text-align:center; font-size:11px; letter-spacing:.25px; }
.modal-backdrop { position:fixed; z-index:20; inset:0; display:grid; place-items:center; padding:20px; background:rgba(0,7,15,.72); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); animation:fade-in .18s ease both; }
.modal-backdrop[hidden] { display:none!important; }
.modal,.modal-card { width:min(100%,390px); min-width:0; padding:28px 24px 23px; text-align:center; border-radius:24px; border:1px solid rgba(255,255,255,.2); background:linear-gradient(145deg,rgba(19,43,64,.97),rgba(5,17,29,.98)); box-shadow:0 30px 90px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.1); animation:modal-in .28s cubic-bezier(.2,.8,.2,1) both; }
.modal-icon { width:62px; height:62px; margin:0 auto 17px; display:grid; place-items:center; border-radius:20px; border:1px solid rgba(74,222,128,.45); background:rgba(34,197,94,.12); color:#4ade80; }
.modal-icon.error { color:#fda4af; border-color:rgba(251,113,133,.4); background:rgba(244,63,94,.1); }
.modal-icon.question { color:var(--yellow); border-color:rgba(234,179,8,.4); background:rgba(234,179,8,.1); }
.modal-icon svg { width:29px; height:29px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.modal h2,.modal-card h2 { margin:0 0 9px; font-size:23px; letter-spacing:-.4px; }
.modal p,.modal-card p { margin:0; color:#c2ceda; font-size:13px; line-height:1.65; overflow-wrap:anywhere; }
.modal-actions { display:flex; gap:10px; margin-top:22px; }
.modal-actions .primary-button,.modal-actions .secondary-button { margin:0; min-height:46px; }
.modal-actions .modal-ok:only-child { width:100%; }
.welcome-card { text-align:center; }
.welcome-card .logo-frame { margin-bottom:22px; }
.welcome-check { width:62px; height:62px; display:grid; place-items:center; margin:0 auto 18px; border-radius:50%; color:#4ade80; border:1px solid rgba(74,222,128,.5); background:rgba(34,197,94,.12); font-size:29px; }
.welcome-card .primary-button { margin-top:24px; }
.link-button { display:flex; color:#17202b; }
.dashboard-card { width:min(100%,620px); }
.dashboard-header { text-align:center; }
.dashboard-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:24px; }
.dashboard-tile { padding:18px 15px; border:1px solid rgba(255,255,255,.16); border-radius:17px; background:rgba(3,13,24,.34); }
.dashboard-tile .tile-icon { width:39px; height:39px; display:grid; place-items:center; margin-bottom:12px; border-radius:12px; color:var(--yellow); border:1px solid rgba(234,179,8,.25); background:rgba(234,179,8,.09); font-size:20px; }
.dashboard-tile h2 { margin:0 0 6px; font-size:14px; }
.dashboard-tile p { margin:0; color:var(--muted); font-size:12px; line-height:1.55; }
.dashboard-bottom { display:flex; align-items:center; gap:14px; margin-top:20px; }
.dashboard-bottom .primary-button { margin-top:0; }
@keyframes card-in { from { opacity:0; transform:translateY(18px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes view-in { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } }
@keyframes modal-in { from { opacity:0; transform:translateY(10px) scale(.96); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes float { from { transform:translate3d(0,0,0) scale(1); } to { transform:translate3d(25px,18px,0) scale(1.08); } }
@keyframes key-pop { 0% { transform:rotate(45deg) scale(.6); } 70% { transform:rotate(-8deg) scale(1.3); } 100% { transform:rotate(0) scale(1.12); } }
@keyframes key-float { 0%,100% { translate:0 0; } 50% { translate:0 -3px; } }
@media (max-width:520px) {
  .page-shell { padding:18px 12px 14px; justify-content:flex-start; }
  .glass-card { width:100%; max-width:470px; padding:25px 20px 18px; border-radius:23px; }
  .logo-frame { width:65px; height:65px; border-radius:20px; }
  .brand { margin-bottom:21px; }
  h1 { font-size:27px; }
  .subtitle { font-size:12px; }
  .input-wrap { min-height:50px; }
  .dashboard-grid { grid-template-columns:minmax(0,1fr); }
  .dashboard-bottom { flex-direction:column; }
}
@media (max-width:360px) {
  .page-shell { padding-left:8px; padding-right:8px; }
  .glass-card { padding-left:15px; padding-right:15px; }
  h1 { font-size:24px; }
  .eyebrow { letter-spacing:1.8px; }
}
@media (max-height:780px) and (min-width:521px) {
  .page-shell { padding-top:18px; padding-bottom:18px; }
  .glass-card { padding-top:23px; padding-bottom:17px; }
  .brand { margin-bottom:18px; }
  .logo-frame { width:59px; height:59px; margin-bottom:12px; }
  .card-footer { margin-top:16px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; scroll-behavior:auto!important; transition-duration:.01ms!important; }

  /* Excepción para mantener activas las animaciones de acceso. */
  .access-animation-overlay.visible .access-tiles {
    animation: accessRoulette 1.2s linear infinite !important;
  }
  .access-animation-overlay.visible .access-tile:nth-child(1) {
    animation: accessTileOne 1.15s ease-in-out infinite !important;
  }
  .access-animation-overlay.visible .access-tile:nth-child(2) {
    animation: accessTileTwo 1.15s ease-in-out infinite !important;
  }
  .access-animation-overlay.visible .access-tile:nth-child(3) {
    animation: accessTileThree 1.15s ease-in-out infinite !important;
  }
  .access-animation-overlay.visible .access-tile:nth-child(4) {
    animation: accessTileFour 1.15s ease-in-out infinite !important;
  }
  .access-animation-overlay.visible .access-progress::after {
    animation: accessProgress 1.2s ease-in-out infinite !important;
  }
  .access-animation-overlay.is-success .access-tiles,
  .access-animation-overlay.is-success .access-tile {
    animation: none !important;
  }
}
