/* Lightweight modal styles for SimpleAuth (kept separate to avoid touching main CSS) */

.sa-lock{overflow:hidden!important;}

.sa-modal{position:fixed;inset:0;display:none;z-index:9999;}
/* Use flex centering so the dialog can cap height and scroll internally without jumping off-screen */
.sa-modal.is-open{display:flex;align-items:center;justify-content:center;padding:16px;}
/* iOS-like backdrop: fade + blur ramps up smoothly */
.sa-backdrop{position:absolute;inset:0;background:rgba(10,6,14,.62);
  backdrop-filter: blur(0px) saturate(110%);
  opacity:0;
  transition:opacity .45s ease, backdrop-filter .45s ease;}
.sa-modal.is-open .sa-backdrop{opacity:1;backdrop-filter: blur(14px) saturate(130%);}


/* Dialog + animation */
.sa-dialog{position:relative;max-width:440px;width:100%;margin:0 auto;
  background: var(--card-grad-1, linear-gradient(36deg, rgba(180,107,255,.22) -18.81%, transparent 51.42%)),
              var(--card-grad-2, linear-gradient(33deg, transparent -2.3%, rgba(255,90,167,.22) 98.42%)),
              var(--card-base, rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.14);border-radius:18px;
  /* No padding on the dialog itself: padding lives in .sa-panel (per request) */
  padding:0;
  box-shadow:0 18px 64px rgba(0,0,0,.55);
  color:#fff;font-family:Montserrat,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  max-height:calc(100vh - 32px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  opacity:0;transform:translateY(42px) scale(.96);
  will-change: transform, opacity;
}

/* iOS-sheet-like entrance with a gentle overshoot */
@keyframes saSheetIn{
  0%{opacity:0;transform:translateY(46px) scale(.955);}
  60%{opacity:1;transform:translateY(-8px) scale(1.012);}
  100%{opacity:1;transform:translateY(0) scale(1);}
}
.sa-dialog.sa-animate{animation:saSheetIn .62s cubic-bezier(.16,1.02,.22,1) both;}
.sa-modal.is-open .sa-dialog{opacity:1;transform:translateY(0) scale(1);} /* fallback */

@media (prefers-reduced-motion: reduce){
  .sa-backdrop,.sa-dialog{transition:none!important;}
}

.sa-close{position:absolute;right:12px;top:12px;width:38px;height:38px;border-radius:14px;border:1px solid rgba(255,255,255,.18);
  background:#39162f;
  color:#fff;font-size:22px;line-height:36px;cursor:pointer;z-index:3;}

/* Layout with optional video */
.sa-layout{display:flex;flex-direction:column;gap:10px;height:100%;min-height:0;padding:0;flex:1;}
.sa-media{position:relative;border-radius:16px;overflow:hidden;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);}
.sa-video{display:block;width:100%;height:auto;object-fit:cover;}
.sa-video--desktop{display:none;}
.sa-video--mobile{display:block;}

.sa-panel{display:flex;flex-direction:column;min-height:0;height:100%;padding:16px;padding-top:0;}

/* Prevent the media block from pushing the form off-screen on short viewports */
@media (max-width: 859px){
  /* Lock dialog height to viewport so content changes don't grow the modal off-screen */
  .sa-dialog{height:calc(100vh - 32px);} 
  /* Let the media block shrink first when errors appear so the form stays visible */
  .sa-layout{flex:1 1 auto;min-height:0;}
  .sa-panel{flex:0 0 auto;overflow:visible;}
  .sa-media{flex:1 1 auto;min-height:30vh;max-height:none;}
  .sa-video{height:100%;}
}

.sa-title{margin:4px 0 6px;font-size:26px;font-weight:900;letter-spacing:.2px;}
.sa-subtitle{margin:0 0 16px;color:rgba(255,255,255,.75);font-size:14px;}

.sa-form{display:flex;flex-direction:column;gap:14px;min-height:0;flex:0;}
.sa-footer{display:flex;flex-direction:column;gap:12px;margin-top:0;}
.sa-field{display:flex;flex-direction:column;gap:8px;}

/* Floating labels */
.sa-field--float{position:relative;}
.sa-field--float input{height:56px;border-radius:16px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:#fff;padding:18px 14px 0;font-size:16px;outline:none;width:100%;}
.sa-field--float input:focus{border-color:rgba(255,255,255,.30);}
.sa-float-label{position:absolute;left:14px;top:18px;color:rgba(255,255,255,.65);font-size:14px;pointer-events:none;
  transform-origin:left top;transition:transform .18s ease, opacity .18s ease, top .18s ease;}
.sa-field--float input:focus + .sa-float-label,
.sa-field--float input:not(:placeholder-shown) + .sa-float-label{
  top:10px;transform:scale(.86);opacity:.9;
}
/* Password tools (label lives inside the input wrap) */
.sa-input-wrap{position:relative;display:flex;align-items:center;}
.sa-input-wrap .sa-float-label{top:18px;}
.sa-input-wrap input:focus ~ .sa-float-label,
.sa-input-wrap input:not(:placeholder-shown) ~ .sa-float-label{top:10px;transform:scale(.86);opacity:.9;}

.sa-input-wrap input{padding-right:54px;}
.sa-icon-btn{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);cursor:pointer;display:grid;place-items:center;}
.sa-eye{width:16px;height:16px;display:block;opacity:.9;filter:drop-shadow(0 2px 6px rgba(0,0,0,.35));
  background:linear-gradient(90deg, var(--accent-1, #ff5aa7), var(--accent-2, #b46bff));
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 5c-7.633 0-11 7-11 7s3.367 7 11 7 11-7 11-7-3.367-7-11-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-2.5A2.5 2.5 0 1 0 12 9a2.5 2.5 0 0 0 0 5.5z"/></svg>') center/contain no-repeat;
          mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 5c-7.633 0-11 7-11 7s3.367 7 11 7 11-7 11-7-3.367-7-11-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-2.5A2.5 2.5 0 1 0 12 9a2.5 2.5 0 0 0 0 5.5z"/></svg>') center/contain no-repeat;
}
.sa-icon-btn.is-on .sa-eye{opacity:1;}

.sa-actions{display:flex;gap:8px;align-items:center;justify-content:flex-start;margin-top:4px;}
.sa-chip{border-radius:999px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.06);color:rgba(255,255,255,.9);font-size:13px;font-weight:800;padding:9px 12px;cursor:pointer;}
.sa-chip:hover{border-color:rgba(255,255,255,.24);}

.sa-error{display:none;background:rgba(255,0,80,.12);border:1px solid rgba(255,0,80,.25);color:#ffd2df;padding:10px 12px;border-radius:12px;font-size:13px;}

.sa-submit{height:56px;border-radius:16px;border:none;cursor:pointer;font-weight:900;font-size:16px;color:#fff;
  background: linear-gradient(90deg, var(--accent-1, #ff5aa7), var(--accent-2, #b46bff));
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.sa-submit:disabled{opacity:.65;cursor:default;}

/* Login/Signup switch */
.sa-switch{display:flex;gap:8px;align-items:center;justify-content:center;margin-top:10px;font-size:12px;color:rgba(255,255,255,.75);}
.sa-link{border:none;background:transparent;color:var(--accent-1, #ff5aa7);font-weight:900;cursor:pointer;padding:0;}
.sa-link:hover{text-decoration:underline;}

/* Desktop split: form left, video right */
@media (min-width: 860px){
  .sa-dialog{max-width:980px;padding:0;}
  .sa-layout{flex-direction:row;align-items:stretch;gap:18px;padding:0;}
  /* Panel left, video right */
  .sa-panel{order:1;}
  .sa-media{order:2;flex:0 0 420px;min-height:0;}
  .sa-video--desktop{display:block;height:100%;}
  .sa-video--mobile{display:none;}
  .sa-video{height:100%;}
  /* Center the form vertically on desktop and keep spacing consistent */
  .sa-panel{flex:1;overflow:hidden;justify-content:center;align-items:stretch;align-self:center;padding:40px;}

  /* Bigger desktop typography */
  .sa-title{font-size:34px;}
  .sa-subtitle{font-size:16px;margin-bottom:18px;}
  .sa-form{gap:18px;}
  .sa-field--float input{height:64px;font-size:18px;border-radius:18px;padding:22px 16px 0;}
  .sa-float-label{font-size:16px;top:22px;}
  .sa-input-wrap .sa-float-label{top:22px;}
  .sa-submit{height:64px;font-size:18px;border-radius:18px;}
  .sa-switch{font-size:13px;}
}

@media (max-width:420px){
  .sa-dialog{width:100%;padding:0;}
}

/* ============================= */
/* FIX BROWSER AUTOFILL STYLES   */
/* ============================= */

.sa-field--float input:-webkit-autofill,
.sa-field--float input:-webkit-autofill:hover,
.sa-field--float input:-webkit-autofill:focus,
.sa-field--float input:-webkit-autofill:active,
.sa-input-wrap input:-webkit-autofill,
.sa-input-wrap input:-webkit-autofill:hover,
.sa-input-wrap input:-webkit-autofill:focus,
.sa-input-wrap input:-webkit-autofill:active {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff !important;

  /* Chrome “white fill” override */
  -webkit-box-shadow: 0 0 0 1000px rgba(255,255,255,.08) inset !important;
  box-shadow: 0 0 0 1000px rgba(255,255,255,.08) inset !important;

  /* Some builds need this to stop the flash */
  transition: background-color 9999s ease-out, color 9999s ease-out;
}

/* Keep floating label visible when autofilled */
.sa-field--float input:-webkit-autofill + .sa-float-label,
.sa-input-wrap input:-webkit-autofill ~ .sa-float-label {
  color: rgba(255,255,255,.65) !important;
  top: 10px;
  transform: scale(.86);
  opacity: .9;
}

/* Firefox */
.sa-field--float input:-moz-autofill,
.sa-input-wrap input:-moz-autofill {
  -moz-text-fill-color: #fff !important;
  box-shadow: 0 0 0 1000px rgba(255,255,255,.08) inset !important;
}
