/* Shared styles for the sign-up, password-reset, email-confirm and panel login pages.
   Copied from the main login page (index.php), which still carries its own inline copy. */
:root {
  --brand: #fd1d3d;
  --brand-hot: #fd1d3d;
  --brand-dark: #d2122f;
  --ink: #1a1216;
  --muted: #77646a;
  --line: rgba(253, 29, 61, 0.14);
  --field-h: 46px;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff5f6;
}

a { color: var(--brand); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--brand-dark); }

/* ============ Shell: exactly one viewport, no scroll ============ */
.auth-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  overflow: hidden;
}

/* ============ Left: animated aurora brand panel ============ */
.brand-panel {
  position: relative;
  overflow: hidden;
  color: #0a0a0a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.6rem, 3.4vh, 3rem) clamp(1.8rem, 3.5vw, 3.6rem);
  background: linear-gradient(160deg, #ffffff 0%, #ffffff 55%, #fff5f6 100%);
  border-right: 1px solid #f3e1e5;
  border-top: 4px solid #fd1d3d;
}

.brand-panel::before,
.brand-panel::after {
  inset: 0;
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 30% 40%, black 18%, transparent 72%);
}

/* aurora blobs */
.brand-panel::before {
  inset: -30%;
  background:
    radial-gradient(34% 28% at 86% 14%, rgba(253, 29, 61, 0.10), transparent 62%),
    radial-gradient(36% 30% at 10% 88%, rgba(253, 29, 61, 0.08), transparent 64%);
  animation: aurora 16s ease-in-out infinite alternate;
  filter: blur(10px);
}

@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(3%, -2%, 0) rotate(2deg) scale(1.05); }
  100% { transform: translate3d(-3%, 2%, 0) rotate(-2deg) scale(1.02); }
}

/* fine grid overlay */
.brand-panel::after {
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 30% 40%, black 18%, transparent 72%);
}

.brand-main, .brand-mid, .brand-foot { position: relative; z-index: 1; }

.brand-logo-row {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: clamp(.9rem, 2.4vh, 1.8rem);
}

.brand-logo-row {
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
}

.brand-logo-img {
  display: block;
  height: clamp(40px, 6.4vh, 56px);
  width: auto;
}

.brand-logo-name small {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .44rem 1rem;
  margin-bottom: clamp(1.2rem, 3.2vh, 2rem);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #d2122f;
  background: #fff0f2;
  border: 1px solid #fbd0d7;
}

.brand-kicker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.8); }
}

.brand-title {
  font-size: clamp(1.9rem, 4.6vh, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.14;
  margin-bottom: clamp(1rem, 2.8vh, 1.7rem);
}

.brand-title .grad {
  background: linear-gradient(90deg, #fd1d3d, #d2122f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-copy {
  max-width: 33rem;
  font-size: clamp(.86rem, 1.8vh, 1rem);
  line-height: 1.85;
  color: #4b5563;
}

/* bento feature chips */
.brand-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: clamp(1.6rem, 4.4vh, 3rem);
  max-width: 33rem;
}

.brand-point {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1.05rem;
  border-radius: 14px;
  font-size: .84rem;
  font-weight: 500;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #eceef1;
  box-shadow: 0 6px 18px rgba(10, 10, 10, 0.04);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.brand-point:hover { transform: translateY(-3px); border-color: #fbd0d7; box-shadow: 0 10px 24px rgba(253, 29, 61, 0.10); }

.brand-point i {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: .9rem;
  color: #fd1d3d;
  background: #fff0f2;
  border: 1px solid #fbd0d7;
}

.brand-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .74rem;
  color: #6b7280;
}

.brand-foot .sys {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.brand-foot .sys .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
}

/* ============ Right: auth panel ============ */
.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(.9rem, 2.4vh, 2rem);
  background:
    radial-gradient(520px 300px at 108% -4%, rgba(253, 29, 61, 0.10), transparent 58%),
    radial-gradient(420px 260px at -8% 106%, rgba(253, 29, 61, 0.07), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #fff6f7 100%);
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(210, 18, 47, 0.13), 0 2px 8px rgba(210, 18, 47, 0.05);
  padding: clamp(1.1rem, 2.6vh, 1.7rem) clamp(1.1rem, 2.2vw, 1.6rem);
  animation: rise .5s cubic-bezier(.2,.8,.25,1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(.55rem, 1.4vh, .9rem);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .3rem .68rem;
  border-radius: 999px;
  background: rgba(253, 29, 61, 0.08);
  color: var(--brand);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.auth-time {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 500;
}

.auth-card h1 {
  font-size: clamp(1.18rem, 2.6vh, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: .15rem;
}

.auth-card .sub {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
  margin-bottom: clamp(.7rem, 1.8vh, 1.05rem);
}

/* segmented login-type control */
.login-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .45rem;
  margin-bottom: clamp(.6rem, 1.6vh, .9rem);
}

.login-type-option { cursor: pointer; }

.login-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.login-type-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(253, 29, 61, 0.16);
  background: #fffafa;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  transition: all .2s ease;
}

.login-type-option span i { font-size: .95rem; color: #c48a93; transition: color .2s ease; }

.login-type-option input:checked + span {
  border-color: var(--brand);
  background: linear-gradient(180deg, rgba(253, 29, 61,.10), rgba(253, 29, 61,.05));
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(253, 29, 61, 0.10);
}

.login-type-option input:checked + span i { color: var(--brand); }
.login-type-option:hover span { border-color: rgba(253, 29, 61, 0.38); transform: translateY(-1px); }

.pm-field {
  position: relative;
  margin-bottom: clamp(.55rem, 1.4vh, .8rem);
}

.form-control {
  width: 100%;
  height: var(--field-h);
  border-radius: 13px;
  border: 1px solid rgba(253, 29, 61, 0.16);
  background: #fffafa;
  padding: 0 2.7rem 0 .95rem;
  font-size: .88rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-control::placeholder { color: #b9a4aa; }

.form-control:focus {
  outline: 0;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(253, 29, 61, 0.12);
}

.pm-field .field-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #c48a93;
  pointer-events: none;
  font-size: .95rem;
}

.pm-field .toggle-password {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #a06b74;
  border-radius: 10px;
  cursor: pointer;
  z-index: 2;
  transition: all .2s ease;
}

.pm-field .toggle-password:hover { color: var(--brand); background: rgba(253, 29, 61, 0.08); }

/* Cloudflare Turnstile widget */
.turnstile-wrap {
  margin-bottom: clamp(.55rem, 1.4vh, .8rem);
  min-height: 66px; /* reserve space so layout doesn't jump while widget loads */
  display: flex;
  align-items: center;
  justify-content: center;
}

.turnstile-wrap .cf-turnstile {
  width: 300px !important; /* Turnstile "normal" size: 300x65 */
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 13px;
  overflow: hidden;
  line-height: 0;
}
/* Cloudflare draws its own square border inside its box: keep the box 1px outside the rounded clip */
.turnstile-wrap .cf-turnstile > div {
  margin: -1px;
  width: calc(100% + 2px) !important;
}
.turnstile-wrap .cf-turnstile:empty { border: 0; }

.btn-pm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  border: 0;
  border-radius: 13px;
  font-family: inherit;
  font-weight: 600;
  font-size: .92rem;
  height: 48px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff1f3d, #d2122f);
  background-size: 150% 150%;
  box-shadow: 0 12px 26px rgba(253, 29, 61, 0.30);
  transition: transform .2s ease, box-shadow .2s ease, background-position .3s ease;
}

.btn-pm:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 16px 32px rgba(253, 29, 61, 0.38);
}

.btn-pm:active { transform: translateY(0); }

.btn-pm i { transition: transform .2s ease; }
.btn-pm:hover i { transform: translateX(3px); }

.login-links {
  margin-top: clamp(.55rem, 1.4vh, .85rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
}

.login-links a { color: var(--muted); font-weight: 500; }
.login-links a:hover { color: var(--brand); }

.auth-note {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #9a858b;
}

.auth-note i { color: #4caf7d; }

/* ============ Responsive: allow scroll only on small screens ============ */
@media (max-width: 900px) {
  body { overflow: auto; }
  .auth-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
  }
  .brand-panel { display: none; }
  .auth-panel { min-height: 100dvh; }
}

@media (max-height: 640px) and (min-width: 901px) {
  .auth-card h1 { font-size: 1.1rem; }
  .auth-card .sub { display: none; }
  :root { --field-h: 42px; }
}

/* ============ Shared additions for the other auth pages ============ */
.auth-panel.is-scroll { overflow-y: auto; align-items: flex-start; }
.auth-panel.is-scroll .auth-card { max-height: none; margin: auto; }
.auth-card.is-wide { max-width: 470px; }

.pm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: .7rem;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: clamp(.55rem, 1.4vh, .8rem);
}
.captcha-row img {
  flex: 0 0 auto;
  height: 46px;
  width: auto;
  padding: 6px 8px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.captcha-row .pm-field { flex: 1 1 auto; margin-bottom: 0; }

.auth-terms {
  margin-top: .7rem;
  font-size: .72rem;
  line-height: 1.55;
  color: #9a858b;
  text-align: center;
}
.auth-terms a { color: var(--brand); font-weight: 500; }

.auth-msg { text-align: center; padding: .4rem 0 .2rem; }
.auth-msg .msg-icon {
  display: inline-grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  font-size: 1.9rem;
  margin-bottom: .9rem;
}
.auth-msg .msg-icon.ok  { color: #1f9d63; background: rgba(31, 157, 99, 0.12); }
.auth-msg .msg-icon.bad { color: var(--brand); background: rgba(253, 29, 61, 0.10); }
.auth-msg p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.65;
  margin-bottom: 1.2rem;
}
a.btn-pm { text-decoration: none; }

@media (max-width: 480px) {
  .pm-grid-2 { grid-template-columns: 1fr; }
}

/* ============ Roomier cards on these pages ============ */
.auth-card {
  max-width: 440px;
  padding: clamp(1.6rem, 3.8vh, 2.4rem) clamp(1.5rem, 2.8vw, 2.2rem);
}
.auth-card.is-wide { max-width: 510px; }
.auth-head { margin-bottom: clamp(1.1rem, 2.6vh, 1.6rem); }
.auth-card h1 { margin-bottom: .5rem; }
.auth-card .sub {
  font-size: .85rem;
  line-height: 1.7;
  margin-bottom: clamp(1.2rem, 2.8vh, 1.7rem);
}
.pm-field,
.captcha-row { margin-bottom: clamp(.9rem, 2.1vh, 1.2rem); }
.captcha-row .pm-field { margin-bottom: 0; }
.btn-pm { margin-top: .3rem; height: 50px; }
.login-links { margin-top: clamp(1.1rem, 2.6vh, 1.5rem); }
.auth-terms { margin-top: 1rem; }

/* SweetAlert popups: same calm look as the rest */
.sweet-overlay { background-color: rgba(17, 24, 39, 0.55) !important; }
.sweet-alert {
  border-radius: 18px !important;
  padding: 24px 24px 22px !important;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.28);
}
.sweet-alert h2 {
  margin: 18px 0 8px !important;
  font-size: 21px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  color: #171717 !important;
}
.sweet-alert p {
  font-size: 14px !important;
  line-height: 1.6 !important;
  font-weight: 400 !important;
  color: #4b5563 !important;
}
.sweet-alert button {
  margin: 20px 5px 0 !important;
  padding: 10px 26px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.sweet-alert button.cancel {
  background-color: #f3f4f6 !important;
  color: #374151 !important;
}
.sweet-alert button.cancel:hover { background-color: #e5e7eb !important; }
.sweet-alert button.confirm { background-color: #fd1d3d !important; }
