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

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

:root{
  --purple:      #5b17d6;
  --purple-dark: #2f0f73;
  --purple-soft: #efe7ff;
  --gold:        #f4c21f;
  --gold-dark:   #c9950a;
  --text:        #1f1f2e;
  --subtext:     #6b7280;
  --border:      #e5e7eb;
  --white:       #ffffff;
  --bg:          #f7f5fc;
  --red:         #e53e3e;
  --green:       #38a169;
}

/* Login / signup / reset: one card, centred on the page */
body.auth-body{
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(123,57,242,0.16), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(244,194,31,0.16), transparent 40%),
    linear-gradient(160deg, #f7f3ff 0%, #f4f6ff 55%, #fffaf0 100%);
  background-attachment: fixed;
}

/* ── WRAPPER ───────────────────────────────────────────────── */
.auth-wrapper{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* ── LEFT PANEL (hidden: the form is the whole page now) ────── */
.auth-wrapper > .auth-left{ display:none; }
.auth-left{
  background: linear-gradient(135deg, #1a0842 0%, #2f0f73 50%, #4a1aad 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
}

.auth-left::before{
  content:"";
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 80% 10%, rgba(244,194,31,0.12), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(123,57,242,0.3), transparent 40%);
}

.auth-left::after{
  content:"";
  position:absolute;
  width:300px; height:300px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,0.06);
  top:-80px; right:-80px;
}

.auth-left-inner{
  position:relative; z-index:2;
  max-width: 460px;
  width:100%;
}

/* LOGO */
.auth-logo{
  display:flex; align-items:center; gap:12px;
  text-decoration:none; margin-bottom:48px;
}
.auth-logo img{
  height:40px; border-radius:10px;
  background:rgba(255,255,255,0.1);
  padding:4px;
}
.auth-logo span{
  color:#fff; font-weight:700; font-size:18px;
}

/* HEADING */
.auth-left-text{ margin-bottom:36px; }
.auth-left-text h1{
  font-size:38px; font-weight:800;
  color:#fff; line-height:1.2;
  margin-bottom:14px;
}
.auth-left-text h1 span{ color:var(--gold); }
.auth-left-text p{
  color:#c9b8f0; font-size:15px; line-height:1.8;
}

/* FEATURES */
.auth-features{
  display:flex; flex-direction:column; gap:14px;
  margin-bottom:40px;
}
.auth-feature{
  display:flex; align-items:flex-start; gap:14px;
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:16px;
  padding:14px 16px;
}
.auth-feature-icon{
  width:40px; height:40px; flex-shrink:0;
  border-radius:12px;
  background:rgba(244,194,31,0.15);
  display:flex; align-items:center; justify-content:center;
}
.auth-feature-icon i{ width:20px; height:20px; color:var(--gold); }
.auth-feature strong{
  display:block; color:#fff;
  font-size:14px; font-weight:600;
  margin-bottom:3px;
}
.auth-feature span{ color:#c9b8f0; font-size:13px; }

/* STATS */
.auth-left-stats{
  display:flex; align-items:center; gap:20px;
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:16px; padding:16px 24px;
}
.auth-stat{ text-align:center; }
.auth-stat strong{ display:block; color:var(--gold); font-size:22px; font-weight:800; }
.auth-stat span{ color:#c9b8f0; font-size:12px; font-weight:500; }
.auth-stat-divider{
  width:1px; height:36px;
  background:rgba(255,255,255,0.15);
}

/* ── RIGHT PANEL ───────────────────────────────────────────── */
.auth-right{
  width:100%;
  display:flex; justify-content:center;
}

.auth-card{
  position:relative;
  width:100%; max-width:440px;
  background:#fff;
  border:1px solid #ece7f7;
  border-radius:24px;
  padding:28px 30px 26px;
  box-shadow:0 24px 60px rgba(63,24,132,0.12);
}

/* Signup has more fields: a little wider so pairs fit side by side */
.auth-card:has(#signupForm){ max-width:560px; }

/* BACK LINK (top-left corner of the card) */
.auth-back{
  position:absolute; top:22px; left:22px;
  display:inline-flex; align-items:center; gap:6px;
  text-decoration:none; color:var(--subtext);
  font-size:13px; font-weight:500;
  padding:4px 8px; border-radius:999px;
  transition:0.2s;
}
.auth-back:hover{ color:var(--purple); background:var(--purple-soft); }
.auth-back i{ width:15px; height:15px; }

/* LOGO at the top of the card */
.auth-card-logo{
  display:block; width:max-content;
  margin:4px auto 14px;
}
.auth-card-logo img{ display:block; height:44px; width:auto; }

/* CARD HEADER */
.auth-card-header{ margin-bottom:20px; text-align:center; }
.auth-card-header h2{
  font-size:24px; font-weight:800;
  color:var(--purple-dark); margin-bottom:4px;
}
.auth-card-header p{ color:var(--subtext); font-size:13.5px; }

/* ALERT BOX */
.alert-box{
  padding:13px 16px;
  border-radius:14px;
  font-size:13px; font-weight:500;
  margin-bottom:18px;
  line-height:1.6;
}
.alert-error{
  background:#fff5f5; color:#c0392b;
  border:1px solid #fcc;
}
.alert-success{
  background:#f0fff4; color:#276749;
  border:1px solid #b2dfcc;
}
.alert-box a{ color:inherit; font-weight:700; }

/* GOOGLE BUTTON */
.google-btn{
  width:100%;
  display:flex; align-items:center; justify-content:center; gap:10px;
  border:1.5px solid var(--border);
  background:#fff;
  padding:13px;
  border-radius:14px;
  cursor:pointer;
  font-family:'Poppins',sans-serif;
  font-size:14px; font-weight:600;
  color:var(--text);
  transition:0.2s ease;
  box-shadow:0 2px 8px rgba(0,0,0,0.05);
}
.google-btn:hover{
  border-color:#bbb;
  box-shadow:0 4px 14px rgba(0,0,0,0.08);
  transform:translateY(-1px);
}

/* DIVIDER: lines on both sides of the text, never wider than the card */
.auth-divider{
  display:flex; align-items:center; gap:12px;
  margin:18px 0;
  color:var(--subtext); font-size:12px;
}
.auth-divider::before,
.auth-divider::after{
  content:""; flex:1; height:1px; background:var(--border);
}
.auth-divider span{ white-space:nowrap; }

/* FORM */
.auth-form{ display:flex; flex-direction:column; gap:12px; }

/* Signup: Email + Phone and Password + Confirm side by side */
#signupForm{
  display:grid;
  grid-template-columns:1fr 1fr;
  column-gap:14px; row-gap:12px;
}
#signupForm > *{ grid-column:1 / -1; }
#signupForm > .form-group:nth-of-type(2),
#signupForm > .form-group:nth-of-type(3),
#signupForm > .form-group:nth-of-type(4),
#signupForm > .form-group:nth-of-type(5){ grid-column:auto; min-width:0; }

.form-group{ display:flex; flex-direction:column; gap:6px; }

.form-group label{
  font-size:13px; font-weight:600; color:#374151;
}

.optional{ font-weight:400; color:var(--subtext); }

/* INPUT WRAP */
.input-wrap{
  display:flex; align-items:center; gap:10px;
  border:1.5px solid var(--border);
  border-radius:14px; padding:0 14px;
  transition:0.2s ease;
  background:#fff;
}
.input-wrap:focus-within{
  border-color:var(--purple);
  box-shadow:0 0 0 4px rgba(91,23,214,0.08);
}
.input-wrap i{ width:18px; height:18px; color:#9ca3af; flex-shrink:0; }
.input-wrap input{
  flex:1; min-width:0; border:none; outline:none;
  padding:11px 0;
  font-family:'Poppins',sans-serif;
  font-size:14px; color:var(--text);
  background:transparent;
}
.input-wrap input::placeholder{ color:#b0b8c8; }

/* EYE BUTTON */
.eye-btn{
  border:none; background:none;
  cursor:pointer; padding:0;
  display:flex; align-items:center;
}
.eye-btn i{ width:18px; height:18px; color:#9ca3af; }

/* FIELD ERROR (takes no space until there is a message) */
.field-error{
  font-size:12px; color:var(--red);
  font-weight:500;
}
.field-error:empty{ display:none; }

/* FORM ROW */
.form-row{
  display:flex; align-items:center;
  justify-content:space-between;
}

/* CHECKBOX */
.checkbox-wrap{
  display:flex; align-items:center; gap:8px;
  cursor:pointer; font-size:13px; color:var(--subtext);
  user-select:none;
}
.checkbox-wrap input[type="checkbox"]{ display:none; }
.checkmark{
  width:18px; height:18px; flex-shrink:0;
  border:2px solid var(--border);
  border-radius:5px;
  display:flex; align-items:center; justify-content:center;
  transition:0.2s;
}
.checkbox-wrap input:checked + .checkmark{
  background:var(--purple); border-color:var(--purple);
}
.checkbox-wrap input:checked + .checkmark::after{
  content:"✓"; color:#fff; font-size:11px; font-weight:700;
}

.forgot-link{
  font-size:13px; color:var(--purple);
  text-decoration:none; font-weight:600;
}
.forgot-link:hover{ text-decoration:underline; }

.terms-wrap{ margin-top:4px; }
.terms-wrap a{ color:var(--purple); font-weight:600; text-decoration:none; }

/* PASSWORD STRENGTH */
.pwd-strength{
  display:flex; align-items:center; gap:10px;
  margin-top:6px;
}
.pwd-bar{
  flex:1; height:5px; background:#e5e7eb;
  border-radius:999px; overflow:hidden;
}
.pwd-bar-fill{
  height:100%; width:0%;
  border-radius:999px;
  transition:width 0.3s ease, background 0.3s ease;
}
.pwd-label{ font-size:12px; font-weight:600; min-width:50px; }

/* SUBMIT BUTTON */
.auth-submit-btn{
  width:100%;
  background:linear-gradient(135deg, var(--purple), #7b39f2);
  color:#fff;
  border:none;
  padding:15px;
  border-radius:14px;
  font-family:'Poppins',sans-serif;
  font-size:15px; font-weight:700;
  cursor:pointer;
  padding:13px;
  box-shadow:0 10px 24px rgba(91,23,214,0.25);
  transition:0.25s ease;
  display:flex; align-items:center; justify-content:center; gap:8px;
  margin-top:4px;
}
.auth-submit-btn:hover:not(:disabled){
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(91,23,214,0.3);
}
.auth-submit-btn:disabled{ opacity:0.7; cursor:not-allowed; }

/* SPIN ANIMATION */
@keyframes spin { to { transform:rotate(360deg); } }
.spin{ animation:spin 0.8s linear infinite; }

/* SWITCH LINK */
.auth-switch{
  text-align:center; margin-top:16px;
  font-size:13.5px; color:var(--subtext);
}
.auth-switch a{
  color:var(--purple); font-weight:700;
  text-decoration:none;
}
.auth-switch a:hover{ text-decoration:underline; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width:600px){
  .auth-wrapper{ padding:16px; align-items:flex-start; }
  .auth-card{ padding:22px 18px 20px; border-radius:20px; }
  .auth-back{ top:14px; left:12px; }
  .auth-card-logo{ margin-top:10px; }
  #signupForm{ grid-template-columns:1fr; }
  #signupForm > .form-group:nth-of-type(n){ grid-column:1 / -1; }
}

@media (max-width:400px){
  .auth-card-header h2{ font-size:21px; }
  .form-row{ flex-wrap:wrap; gap:8px; }
}
/* ── FIT ON ONE SCREEN (compact sizes; login + signup without scrolling) ── */
.auth-wrapper{ padding:16px; }
.auth-card{ padding:20px 26px 18px; }
.auth-back{ top:16px; left:16px; }
.auth-card-logo{ margin:0 auto 8px; }
.auth-card-logo img{ height:36px; }
.auth-card-header{ margin-bottom:14px; }
.auth-card-header h2{ font-size:21px; margin-bottom:2px; }
.auth-card-header p{ font-size:13px; }
.alert-box{ padding:10px 14px; margin-bottom:12px; }
.google-btn{ padding:10px; font-size:13.5px; }
.auth-divider{ margin:12px 0; }
.auth-form{ gap:10px; }
#signupForm{ row-gap:10px; }
.form-group{ gap:4px; }
.form-group label{ font-size:12.5px; }
.input-wrap input{ padding:9px 0; font-size:13.5px; }
.auth-submit-btn{ padding:11px; margin-top:2px; }
.auth-switch{ margin-top:12px; font-size:13px; }

/* Short screens (small laptops, landscape phones): drop the sub-line, smaller logo */
@media (max-height:640px){
  .auth-card-logo img{ height:30px; }
  .auth-card-header{ margin-bottom:10px; }
  .auth-card-header p{ display:none; }
  .auth-divider{ margin:9px 0; }
  .auth-form, #signupForm{ gap:8px; row-gap:8px; }
  .input-wrap input{ padding:8px 0; }
  .auth-switch{ margin-top:9px; }
}
