@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap"); 

/* ========================
   GLOBAL VARIABLES
======================== */
:root {
  --error: #D32F2F;
  --success: #2E7D32;
  --accent: #A855F7;   /* minimal purple */
  --text-dark: #1E1E2F;
  --text-light: #ffffff;
  --bg-light: #ffffff;
  --bg-dark: #1E1E2F;
  --overlay: rgba(0, 0, 0, 0.05);
}

/* ========================
   RESET
======================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* ========================
   BODY + BACKGROUND
======================== */
html, body {
  height: 100%;
}
/* Third soft blob near top-right using html::before */
html::before {
  content: "";
  position: fixed;
  width: 760px;
  height: 760px;
  top: -10%;
  right: 6%;
  background: radial-gradient(circle at 50% 50%, rgba(139,92,246,0.50) 0%, rgba(139,92,246,0.28) 32%, transparent 64%);
  filter: blur(54px);
  opacity: 0.50;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
  /* 4x the logo float (6.5s) */
  animation: wallpaperFloatC 26s ease-in-out infinite alternate;
  animation-delay: -1.625s;
}

@keyframes wallpaperFloatC {
  0% { transform: translate3d(0,0,0) rotate(0deg); }
  100% { transform: translate3d(-2%, 3%, 0) rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
  html::before { animation: none; opacity: 0.28; }
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 12px;
  /* subtle, modern background with soft radial lighting */
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(168,85,247,0.08), transparent 60%),
    radial-gradient(1000px 520px at 110% 10%, rgba(59,130,246,0.08), transparent 60%),
    linear-gradient(180deg, #fafafa 0%, #f6f7fb 100%);
  color: var(--text-dark);
  position: relative; /* allow pseudo-elements to layer as live wallpaper */
}
/* Live wallpaper: floating, blurred gradient blobs (brand purple forward) */
body::before {
  content: "";
  position: fixed;
  width: 980px;
  height: 980px;
  top: -16%;
  left: -12%;
  background: radial-gradient(circle at 40% 40%, rgba(168,85,247,0.60) 0%, rgba(168,85,247,0.36) 32%, transparent 62%);
  filter: blur(56px);
  opacity: 0.58;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
  /* 2x the logo float (6.5s) for rhythm */
  animation: wallpaperFloatA 13s ease-in-out infinite alternate;
  animation-delay: -3.25s;
}

body::after {
  content: "";
  position: fixed;
  width: 1080px;
  height: 1080px;
  right: -14%;
  bottom: -22%;
  background: radial-gradient(circle at 60% 60%, rgba(126,34,206,0.52) 0%, rgba(126,34,206,0.30) 36%, transparent 64%);
  filter: blur(64px);
  opacity: 0.54;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
  /* 3x the logo float */
  animation: wallpaperFloatB 19.5s ease-in-out infinite alternate;
  animation-delay: -6.5s;
}

@keyframes wallpaperFloatA {
  0% { transform: translate3d(0,0,0) rotate(0deg); }
  100% { transform: translate3d(3%, 2%, 0) rotate(10deg); }
}
@keyframes wallpaperFloatB {
  0% { transform: translate3d(0,0,0) rotate(0deg); }
  100% { transform: translate3d(-2%, -3%, 0) rotate(-10deg); }
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; opacity: 0.22; }
}

/* ========================
   AUTH CARD (wrapper)
   NOTE: overflow is hidden on desktop so hidden panel cannot be scrolled into view.
   Internal forms will scroll instead if content is tall.
======================== */
.wrapper {
  width: 100%;
  max-width: 600px;
  border-radius: 12px;
  padding: 36px 40px;
  text-align: center;
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid #ddd;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.wrapper.login-form { width: 480px; }

.wrapper.larger-form {
  width: clamp(700px, 90vw, 1000px);
  max-width: 92vw;
  margin: 0 auto;
  padding: 28px 32px;
  border-radius: 14px;
  background: var(--bg-light);
  border: 1px solid #ddd;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);

  /* <-- critical containment to prevent the alternate panel being revealed
     by page scroll or zoom. On desktop this keeps the slider inside this box. */
  overflow: hidden;
  max-height: calc(100vh - 32px);
}

/* ========================
   FORM BASICS
======================== */
form { display: flex; flex-direction: column; }

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Grid rows
   Use minmax(0,1fr) so columns can shrink and not force overflow */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* ========================
   INPUT FIELDS
======================== */
/* Ensure children can shrink inside flex/grid parents */
.auth-slider,
.auth-panel,
.auth-panel form,
.form-row,
.form-row-3,

.input-field {
  min-width: 0;
  box-sizing: border-box;
}

.input-field {
  position: relative;
  margin: 16px 0;
  flex: 1 1 auto;
  width: 100%;
}
.input-field input {
  width: 100%;
  min-height: 44px;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  font-size: 1rem;
  color: var(--text-dark);
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  padding-right: 36px;
  box-sizing: border-box;
}
.input-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 4px rgba(168, 85, 247, 0.4);
}

/* floating label */
.input-field label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.85rem;
  pointer-events: none;
  transition: 0.14s ease;
  background: var(--bg-light);
  padding: 0 6px;
}
.input-field input:not([type="password"]) {
  color: var(--text-dark) !important;
  -webkit-text-security: none; /* defensive: ensure no "bullet" mask applied in some non-standard cases */
}

/* support class applied by JS when input has a value */
.input-field input.has-value ~ label,
.input-field input:focus ~ label,
.input-field input:not(:placeholder-shown) ~ label {
  top: -8px;
  font-size: 0.75rem;
  color: var(--accent);
  transform: none; 

}

/* validation states */
.input-field.error input { border-color: var(--error); }
.input-field.error label { color: var(--error); }
.input-field.success input { border-color: var(--success); }
.input-field.success label { color: var(--success); }

/* ========================
   Error message: modern, non-overlapping + tooltip-on-hover/focus
   - inline snippet clamps to one line with ellipsis (keeps layout)
   - full message appears in a body-attached tooltip (styled) on hover/focus/touch
   - no changes to label / input spacing
======================== */
.input-field .error {
  color: var(--error);
  font-size: 0.78rem;
  line-height: 1.25;
  position: absolute;
  top: calc(100% + 8px);
  left: 12px;
  right: 12px;

  /* force single line with ellipsis */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

  cursor: help; /* indicates more on hover/focus */
  margin: 0; padding: 0; background: transparent; z-index: 3; /* sits above form but below body-attached tooltip */
}

/* small focus style for keyboard users on the inline error */
.input-field .error:focus {
  outline: 2px solid rgba(211,47,47,0.12);
  outline-offset: 2px;
}

/* keep inline error accessible to screen readers (JS will set data-full-error/title) */
.input-field .error[aria-hidden="true"] {
  /* if a UA sets aria-hidden we still want visual present (rare) */
  opacity: 1;
}

/* small mitigation so absolute message area doesn't overlap inputs visually
   when form scrolled — inner form padding-bottom keeps room (no layout changes) */
.auth-panel form {
  width:100%;
  max-width:420px;
  margin:0 auto;
  /* inner scrolling if the form is taller than available height */
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding-right: 8px; /* small breathing room for scrollbar */
  -webkit-overflow-scrolling: touch;

  /* small extra bottom padding to make room for absolute error blocks */
  padding-bottom: 28px;
}

/* ========================
   Modern body-attached tooltip (used by JS)
   - appended to document.body so it won't be clipped
   - JS sets .visible and direction classes (.gso-tooltip--top / --bottom)
======================== */
.gso-tooltip {
  position: absolute;
  z-index: 99999;
  background: #0f1724;            /* near-black modern look */
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.3;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 360px;
  box-shadow: 0 8px 28px rgba(2,6,23,0.45);
  pointer-events: none;           /* becomes enabled when visible */
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
  word-wrap: break-word;
  left: 0;
  top: 0;
}

/* visible state */
.gso-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* subtle accent bar on the left to hint "error" (optional) */
.gso-tooltip::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
   display: none;
  width: 4px;
  background: var(--error);
  border-radius: 2px;
  opacity: 0.98;
}

/* arrow — rotated square; placement varies with direction classes */
.gso-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: inherit;
  z-index: -1;
  box-shadow: 0 8px 28px rgba(2,6,23,0.45);
}

/* arrow placement: top = tooltip above target (arrow points down) */
.gso-tooltip--top::after {
  bottom: -5px;
}
/* bottom = tooltip below target (arrow points up) */
.gso-tooltip--bottom::after {
  top: -5px;
}

/* responsive fallback */
@media (max-width: 420px) {
  .gso-tooltip {
    max-width: calc(100vw - 32px);
    font-size: 0.82rem;
    padding: 8px 10px;
    border-radius: 7px;
  }
}

/* ========================
   ERROR ALERTS
======================== */
.error-alert {
  background: var(--error);
  color: #fff;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  text-align: center;
  animation: fadeIn 0.25s ease-in-out;
}
@keyframes fadeIn {
  from {opacity:0; transform:translateY(-4px);}
  to {opacity:1; transform:none;}
}

/* ========================
   BUTTONS
======================== */
button {
  width: 100%;
  margin-top: 18px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.18s ease, transform 0.12s ease;
}
button:hover {
  background: #9333ea;
  transform: translateY(-1px);
}

/* Disabled submit visual state (small, accessible hint) */
button[disabled],
input[type="submit"][disabled] {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(6%);
  transition: opacity 120ms ease, transform 120ms ease;
}
button[disabled]:hover,
input[type="submit"][disabled]:hover {
  transform: none;
  background: var(--accent);
}

/* ========================
   FORM OPTIONS
======================== */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 20px;
  font-size: 0.9rem;
  color: var(--text-dark);
}
.form-options .remember { display:flex; align-items:center; gap:8px; }
.form-options input[type="checkbox"] {
  accent-color: var(--accent);
  transform: scale(1.05);
  cursor: pointer;
}
.form-options .forgot-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.form-options .forgot-link:hover { text-decoration: underline; }

/* ========================
   LINKS / FOOTER
======================== */
.register { text-align:center; margin-top: 16px; }
.register p { color: var(--text-dark); }
.register a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.register a:hover { text-decoration: underline; }

/* ========================
   SMALL UI PIECES
======================== */
@keyframes shake {
  0%,100%{transform:translateX(0);}
  20%,60%{transform:translateX(-6px);}
  40%,80%{transform:translateX(6px);}
}
.wrapper.shake { animation: shake 0.3s ease; }

.optional { font-size:0.75rem; color:#777; }
.password-eye {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--accent);
  font-size: 1rem;
  z-index: 2;
}
.password-eye:hover { color:#333; }

/* ========================
   TWO-PANEL / OVERLAY
======================== */
.auth-wrapper { position: relative; }

/* slider: side-by-side on desktop */
.auth-slider { display:flex; width:100%; align-items:stretch; gap:0; height:100%; }

/* panels: allow shrink/grow and be contained by wrapper */
.auth-panel {
  flex: 1 1 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 12px;
  box-sizing: border-box;
  min-width: 0;
}

/* IMPORTANT: keep forms scrollable inside the panel so page itself doesn't grow.
   This prevents scroll/zoom from revealing the opposite panel. */

/* overlay panel (unchanged visually) */
.auth-cover {
  position: absolute;
  top: 0;
  left: 50%;                     /* desktop positions: 50% = cover right, 0 = cover left */
  width: 50%;
  height: 100%;
  z-index: 12;
  transition: left 0.45s cubic-bezier(.25,.8,.25,1), transform 0.45s ease;
  /* vibrant gradient cover — purple-forward */
  background: linear-gradient(135deg, #1e1b2e 0%, #2a1846 25%, #3a1670 55%, #4c1d95 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.32);
  will-change: left, transform;
}

/* helper classes if you toggle via classes */
.auth-cover.cover-right { left: 50%; }
.auth-cover.cover-left  { left: 0; }

.auth-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  /* softly animated decorative lights */
  background-image:
    radial-gradient(600px 320px at 18% 18%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(520px 280px at 82% 78%, rgba(168,85,247,0.20), transparent 70%),
    radial-gradient(560px 300px at 92% 10%, rgba(126,34,206,0.20), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* extra, slow-moving glow for depth */
.auth-cover::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  filter: blur(60px);
  background: radial-gradient(circle at center, rgba(168,85,247,0.38), rgba(126,34,206,0.22) 60%, transparent 70%);
  top: 10%;
  left: -12%;
  z-index: 0;
  opacity: 0.75;
  transform: translate3d(0,0,0);
}

.auth-cover .cover-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 24px 20px;
  text-align: center;
  color: #E6E7EA;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
  /* glass card for improved legibility */
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
}

.auth-cover .cover-logo {
  width: 140px;
  max-width: 140px;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
  animation: coverFloat 6.5s ease-in-out infinite;
}

@keyframes coverFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .auth-cover .cover-logo { animation: none; }
}

/* refined typography for title/sub/desc/meta */
.auth-cover .cover-text {
  padding: 6px 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; /* tighter, more professional spacing */
}
.auth-cover .cover-text .cover-title {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: #ffffff;
  font-size: 1.12rem;
  line-height: 1.28;
}
.auth-cover .cover-text .cover-sub {
  color: #d7d9dd;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.95;
}
.auth-cover .cover-text .cover-desc {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 34ch;
  text-align: center;
}
.auth-cover .cover-text .cover-meta {
  color: #a5b4fc;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.8rem;
}

.switch-text {
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
  color: var(--accent);
}
.switch-text:hover { text-decoration: underline; }

/* ========================
   RESPONSIVE
   On smaller screens we revert to scrollable wrapper and stacked layout
   so users can access all fields (mobile usability).
======================== */

/* Tablet / narrower desktop */
@media (max-width: 1100px) {
  .wrapper.larger-form {
    width: clamp(680px, 94vw, 980px);
    padding: 20px 22px;
    /* keep contained but allow more vertical space */
    max-height: calc(100vh - 28px);
  }

  .auth-panel { padding: 14px; }
  .auth-panel form { max-width: 380px; max-height: calc(100vh - 170px); }

  /* grid tweaks */
  .form-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .form-row-3 { gap: 10px; grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* Mobile / stacked behavior */
@media (max-width: 720px) {
  /* Scale wallpaper for mobile to keep performance tidy */
  body::before { width: 600px; height: 600px; top: -22%; left: -30%; filter: blur(48px); opacity: 0.46; }
  body::after { width: 640px; height: 640px; right: -28%; bottom: -28%; filter: blur(52px); opacity: 0.44; }
  html::before { width: 460px; height: 460px; top: -18%; right: -10%; filter: blur(42px); opacity: 0.40; }
  .wrapper.larger-form {
    width: 100;
    padding: 14px 16px;
    border-radius: 12px;
    /* allow page scrolling on small screens (so mobile users can scroll through the single-column forms) */
    overflow: visible;
    max-height: none;
  }

  /* stack panels vertically */
  .auth-slider { flex-direction: column; gap: 12px; }

  .auth-panel {
    flex: 0 0 auto;
    width: 100%;
    padding: 12px;
    align-items: flex-start;
  }

  /* forms take full width and become natural flow (no inner scroll necessary) */
  .auth-panel form { width: 100%; max-width: 100%; margin: 0; max-height: none; overflow: visible; padding-bottom: 12px; }

  /* overlay becomes a top bar */
  .auth-cover {
    left: 0 !important;
    width: 100% !important;
    height: 160px;
    top: 0;
    border-radius: 12px 12px 0 0;
    transition: transform 0.36s cubic-bezier(.2,.9,.2,1);
    transform: translateY(0);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.28);
  }

  .auth-cover .cover-content { padding: 10px 12px; gap: 6px; max-width: 100%; background: rgba(255,255,255,0.06); border-radius: 12px; }
  .auth-cover .cover-logo { width: 54px; max-width: 54px; animation: coverFloatMobile 7s ease-in-out infinite; }
  @keyframes coverFloatMobile { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
  .auth-cover .cover-text .cover-title { font-size: 0.98rem; }
  .auth-cover .cover-text .cover-sub { font-size: 0.88rem; }
  .auth-cover .cover-text .cover-desc { display:none; }
  .auth-cover .cover-text .cover-meta { font-size: 0.76rem; }

  /* name fields: on narrow screens make last name full width below */
  .form-row-3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-row-3 > .input-field:nth-child(3) { grid-column: 1 / -1; }
}

/* Very small screens */
@media (max-width: 360px) {
  .wrapper.larger-form { padding: 10px; border-radius: 10px; }
  .auth-cover { display: none; } /* free vertical space on tiny devices */
  .form-row { grid-template-columns: 1fr; gap: 8px; }
  .form-row-3 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .form-row-3 > .input-field:nth-child(3) { grid-column: 1 / -1; }
}

/* Accessibility / zoom safety helpers */
@media (min-resolution: 2dppx) and (max-width: 1400px) {
  .auth-panel form { max-width: 420px; }
}

/* Banner inside auth wrapper */
.wrapper .banner {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:8px;
  margin-top: 12px;
  font-weight:700;
}
.wrapper .banner.success { background: linear-gradient(90deg,#6d28d9,#4f46e5); color: #fff; }
.wrapper .close-banner { background:transparent; border:none; color:inherit; cursor:pointer; font-size:18px; padding:0 6px; }

/* ===== cover register banner (appears inside the auth-cover) ===== */
.cover-register-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translate(-50%, -120%);
  transition: transform 360ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease;
  opacity: 0;
  background: linear-gradient(90deg, #9333ea, #7e22ce);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  z-index: 60;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
  max-width: calc(100% - 64px);
  box-sizing: border-box;
  white-space: nowrap;        /* keep content on one line */
  overflow: hidden;
  text-overflow: ellipsis;   /* truncate if still too long */
  justify-content: center;
}

.cover-register-banner.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}




