/* =============================================
   WASHTUBE — LOGIN MODAL + CHARACTER
   ============================================= */

/* ── OVERLAY ── */
.wt-login-overlay {
  position: fixed; inset: 0;
  background: rgba(4,77,115,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.wt-login-overlay.is-open { opacity: 1; pointer-events: all; }

.wt-login-modal {
  position: relative;
  width: 100%; max-width: 320px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);   /* never taller than the visible page, so nothing clips off-screen */
  border-radius: 16px;
  overflow: hidden;                  /* keeps the rounded corners */
  overflow-y: auto;                  /* if the form is tall, scroll inside instead of clipping */
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  transform: translateY(-24px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.wt-login-overlay.is-open .wt-login-modal {
  transform: translateY(0) scale(1);
}

.wt-login-close {
  position: absolute; top: 10px; right: 10px; z-index: 10;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.08); border: none;
  color: #555; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.wt-login-close:hover { background: rgba(220,53,53,0.15); color: #e03535; }

/* ── FORM WRAPPER ── */
.wt-login-modal .wt-lf {
  --border: rgba(0,0,0,0.125);
  --borderDark: rgba(0,0,0,0.25);
  --borderDarker: rgba(0,0,0,0.5);
  --bgColorH: 0; --bgColorS: 0%; --bgColorL: 98%;
  --fgColorH: 210; --fgColorS: 50%; --fgColorL: 38%;
  --borderRadius: 0.125rem;
  --hair: rgb(60,90,160);
  background: white;
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  display: flex; flex-direction: column;
  padding: 1rem;
  position: relative; overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* Email link */
.wt-login-modal .wt-lf .wt-lf-links {
  order: 5;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-top: 0.5rem;
}
.wt-login-modal .wt-lf .wt-lf-links a {
  color: hsl(var(--fgColorH), var(--fgColorS), var(--fgColorL));
  font-size: 0.8rem;
  text-align: center;
  outline: 1px dashed transparent; outline-offset: 2px;
  text-decoration: none;
  transition: color 0.25s;
}
.wt-login-modal .wt-lf .wt-lf-links a:hover {
  color: hsl(var(--fgColorH), var(--fgColorS), calc(var(--fgColorL) * 0.75));
}
.wt-login-modal .wt-lf .wt-lf-register-link {
  font-weight: 700;
  color: var(--blue-mid) !important;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 8px; margin-top: 2px;
  width: 100%; text-align: center;
}

/* Error message */
.wt-login-error {
  order: 4;
  background: #fef2f2; border: 1px solid #fcc;
  border-radius: 6px; padding: 8px 12px;
  font-size: 12px; color: #c0392b;
  margin-top: 8px; margin-bottom: -4px;
}

/* Same box, used to confirm a password change. */
.wt-login-error.is-success {
  background: #effaf3; border-color: #bfe6cd; color: #1b7a43;
}

/* form > div (field wrappers) */
.wt-login-modal .wt-lf > div:not(.wt-login-error):not(.wt-lf-links) { order: 2; }

/* labels */
.wt-login-modal .wt-lf label {
  display: flex; flex-direction: column;
}
.wt-login-modal .wt-lf .label-show-password { order: 3; }
.wt-login-modal .wt-lf label > span {
  color: var(--borderDarker); display: block;
  font-size: 0.825rem; margin-top: 0.625rem;
  order: 1; transition: all 0.25s;
}
.wt-login-modal .wt-lf label > span.required::after {
  content: "*"; color: #dd6666; margin-left: 0.125rem;
}
.wt-login-modal .wt-lf label input { order: 2; outline: none; }
.wt-login-modal .wt-lf label input::placeholder { color: var(--borderDark); }
.wt-login-modal .wt-lf label input[name="pwd"] { -webkit-text-security: disc; }
.wt-login-modal .wt-lf input[name="show-password"]:checked ~ div label input[name="pwd"] {
  -webkit-text-security: none;
}
.wt-login-modal .wt-lf label:hover span {
  color: hsl(var(--fgColorH), var(--fgColorS), var(--fgColorL));
}
.wt-login-modal .wt-lf label:hover input.text {
  border-color: hsl(var(--fgColorH), var(--fgColorS), var(--fgColorL));
}
.wt-login-modal .wt-lf label input.text:focus,
.wt-login-modal .wt-lf label input.text:active {
  border-color: hsl(var(--fgColorH), calc(var(--fgColorS) * 2), calc(var(--fgColorL) * 1.15));
  box-shadow: 0 1px hsl(var(--fgColorH), calc(var(--fgColorS) * 2), calc(var(--fgColorL) * 1.15));
}
.wt-login-modal .wt-lf input.text:focus + span,
.wt-login-modal .wt-lf input.text:active + span {
  color: hsl(var(--fgColorH), calc(var(--fgColorS) * 2), calc(var(--fgColorL) * 1.15));
}

/* inputs */
.wt-login-modal .wt-lf input {
  border: 1px solid var(--border);
  border-radius: var(--borderRadius);
  box-sizing: border-box;
  font-size: 1rem; height: 2.25rem; line-height: 1.25rem;
  margin-top: 0.25rem; order: 2;
  padding: 0.25rem 0.5rem;
  width: 100%; transition: all 0.25s;
}

/* submit */
.wt-login-modal .wt-lf input[type="submit"] {
  color: hsl(var(--bgColorH), var(--bgColorS), var(--bgColorL));
  background: hsl(var(--fgColorH), var(--fgColorS), var(--fgColorL));
  font-size: 0.75rem; font-weight: bold;
  margin-top: 0.625rem; order: 4;
  outline: 1px dashed transparent; outline-offset: 2px;
  padding-left: 0; text-transform: uppercase; cursor: pointer;
}
.wt-login-modal .wt-lf input[type="submit"]:hover {
  background: hsl(var(--fgColorH), var(--fgColorS), calc(var(--fgColorL) * 0.75));
}
.wt-login-modal .wt-lf input[type="submit"]:active {
  background: hsl(var(--fgColorH), calc(var(--fgColorS) * 2), calc(var(--fgColorL) * 1.15));
  transition: all 0.125s;
}
.wt-login-modal .wt-lf input[type="submit"].is-loading {
  opacity: 0.7; cursor: wait;
}

/* checkbox */
.wt-a11y-hidden {
  position: absolute; top: -1000em; left: -1000em;
}
.wt-login-modal .wt-lf input[type="checkbox"] + label span {
  padding-left: 1.25rem; position: relative;
}
.wt-login-modal .wt-lf input[type="checkbox"] + label span::before {
  content: ""; display: block; position: absolute;
  top: 0; left: 0; width: 0.75rem; height: 0.75rem;
  border: 1px solid var(--borderDark); border-radius: var(--borderRadius);
  transition: all 0.25s; outline: 1px dashed transparent; outline-offset: 2px;
}
.wt-login-modal .wt-lf input[type="checkbox"]:checked + label span::after {
  content: ""; display: block; position: absolute;
  top: 0.1875rem; left: 0.1875rem;
  width: 0.375rem; height: 0.375rem;
  border: 1px solid var(--borderDark); border-radius: var(--borderRadius);
  background: hsl(var(--fgColorH), var(--fgColorS), var(--fgColorL));
  transition: all 0.25s;
}

/* ── CHARACTER FIGURE ── */
.wt-login-modal .wt-lf figure {
  --skinH: 30; --skinS: 100%; --skinL: 87%;
  background: hsl(var(--fgColorH), calc(var(--fgColorS) * 2), 95%);
  border: 1px solid rgba(0,0,0,0.0625);
  border-radius: 50%;
  height: 0; margin: auto auto; margin-bottom: 1.5rem;
  order: 1; padding-top: 60%;
  position: relative; width: 60%; overflow: hidden;
}
.wt-login-modal .wt-lf figure div {
  position: absolute; transform: translate(-50%, -50%);
}
.wt-login-modal .wt-lf figure .skin {
  background: hsl(var(--skinH), var(--skinS), var(--skinL));
  box-shadow: inset 0 0 3rem hsl(var(--skinH), var(--skinS), calc(var(--skinL) * 0.95));
}
.wt-login-modal .wt-lf figure .head {
  top: 40%; left: 50%; width: 60%; height: 60%;
  border-radius: 100%; box-shadow: 0 -0.175rem 0 0.125rem var(--hair);
}
.wt-login-modal .wt-lf figure .ears {
  top: 47%; left: 50%; white-space: nowrap;
}
.wt-login-modal .wt-lf figure .ears::before,
.wt-login-modal .wt-lf figure .ears::after {
  content: "";
  background: hsl(var(--skinH), var(--skinS), var(--skinL));
  border-radius: 50%; width: 1rem; height: 1rem;
  display: inline-block; margin: 0 2.1rem;
}
.wt-login-modal .wt-lf figure .head .eyes {
  top: 55%; left: 50%; white-space: nowrap;
}

@keyframes wt-blink {
  0%, 90%, 100% { height: 10px; }
  95% { height: 0; }
}

.wt-login-modal .wt-lf figure .head .eyes::before,
.wt-login-modal .wt-lf figure .head .eyes::after {
  content: "";
  background: var(--borderDarker); border-radius: 50%;
  width: 10px; height: 10px; display: inline-block;
  margin: 0 0.5rem;
  animation: wt-blink 5s infinite; transition: all 0.15s;
}
.wt-login-modal .wt-lf input[name="show-password"]:checked ~ figure .head .eyes::before,
.wt-login-modal .wt-lf input[name="show-password"]:checked ~ figure .head .eyes::after {
  height: 0.125rem; animation: none;
}

.wt-login-modal .wt-lf figure .head .mouth {
  border: 0.125rem solid transparent;
  border-bottom: 0.125rem solid var(--borderDarker);
  width: 25%; border-radius: 50%;
  transition: all 0.5s;
}
.wt-login-modal .wt-lf:invalid figure .head .mouth {
  top: 75%; left: 50%; height: 10%;
}
.wt-login-modal .wt-lf:valid figure .head .mouth {
  top: 60%; left: 50%; width: 40%; height: 40%;
}

.wt-login-modal .wt-lf figure .hair {
  top: 40%; left: 50%; width: 66.66%; height: 66.66%;
  border-radius: 100%; overflow: hidden;
}
.wt-login-modal .wt-lf figure .hair::before {
  content: ""; display: block; position: absolute;
  width: 100%; height: 100%;
  background: var(--hair); border-radius: 50%;
  top: -60%; left: -50%; box-shadow: 4rem 0 var(--hair);
}
.wt-login-modal .wt-lf figure .neck {
  width: 10%; height: 40%; top: 62%; left: 50%;
  background: hsl(var(--skinH), var(--skinS), calc(var(--skinL) * 0.94));
  border-radius: 0 0 2rem 2rem; box-shadow: 0 0.25rem var(--border);
}
.wt-login-modal .wt-lf figure .person-body {
  width: 60%; height: 100%; border-radius: 50%;
  left: 50%; top: 126%;
  background: hsl(var(--fgColorH), var(--fgColorS), var(--fgColorL));
}
.wt-login-modal .wt-lf figure .shirt-1,
.wt-login-modal .wt-lf figure .shirt-2 {
  width: 12%; height: 7%;
  background: hsl(var(--bgColorH), var(--bgColorS), var(--bgColorL));
  top: 76%; left: 36.5%;
  transform: skew(-10deg) rotate(15deg);
}
.wt-login-modal .wt-lf figure .shirt-2 {
  left: 52.5%; transform: skew(10deg) rotate(-15deg);
}

/* ── MODAL TAB HEADER (Login / Register tabs) ── */
.wt-login-tabs {
  display: flex; background: var(--blue-dark);
}
.wt-login-tab {
  flex: 1; padding: 12px; text-align: center;
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.65);
  cursor: pointer; border: none; background: transparent;
  transition: color 0.2s, background 0.2s; font-family: inherit;
}
.wt-login-tab.is-active {
  color: #fff; background: rgba(255,255,255,0.12); border-bottom: 2px solid var(--gold);
}
.wt-login-tab:hover:not(.is-active) { color: rgba(255,255,255,0.9); }

/* Tab panels */
.wt-login-panel { display: none; }
.wt-login-panel.is-active { display: block; }

/* Quick register panel matches login panel background */
#wt-panel-register {
  background: #ffffff;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px;
}
