/* ================================================
   Auth Pages — Login & Register
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #5b4cff;
  --primary-dark: #3d2fcc;
  --primary-light:#7b6dff;
  --accent:       #ff6b6b;
  --dark:         #0d0d1a;
  --dark2:        #13132b;
  --card-bg:      #181830;
  --card-border:  rgba(255,255,255,.08);
  --input-bg:     #1e1e3a;
  --input-border: rgba(255,255,255,.1);
  --input-focus:  rgba(91,76,255,.5);
  --text:         #e8e8f0;
  --text-muted:   #7070a0;
  --white:        #ffffff;
  --error:        #ff6b6b;
  --success:      #43e97b;
  --warning:      #ffd93d;
  --radius:       14px;
  --radius-sm:    8px;
  --transition:   .25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===== BACKGROUND ===== */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .45;
}
.auth-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(91,76,255,.5), transparent 70%);
  top: -200px; left: -150px;
  animation: blobDrift 10s ease-in-out infinite;
}
.auth-blob-2 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(255,107,107,.35), transparent 70%);
  bottom: -150px; right: -100px;
  animation: blobDrift 13s ease-in-out infinite reverse;
}
@keyframes blobDrift {
  0%,100% { transform: translate(0,0); }
  50%      { transform: translate(40px,-30px); }
}

/* ===== LAYOUT ===== */
.auth-page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px 60px;
}

/* ===== HEADER ===== */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo {
  display: inline-block;
  margin-bottom: 12px;
}
.auth-logo img { height: 44px; }
.auth-logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #7b6dff, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: block;
}
.auth-tagline { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }

/* ===== CARD ===== */
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  animation: cardIn .5s ease;
}
.auth-card.auth-card-wide { max-width: 680px; }
@keyframes cardIn {
  from { opacity:0; transform: translateY(24px); }
  to   { opacity:1; transform: translateY(0); }
}

.auth-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
}
.auth-card-sub {
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: 28px;
}

/* ===== SECTION DIVIDER ===== */
.form-section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin: 24px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section-label::before,
.form-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.07);
}

/* ===== INPUT GROUP ===== */
.auth-field {
  margin-bottom: 16px;
}
.auth-field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.auth-field label .req { color: var(--primary-light); margin-left: 2px; }
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--white);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.input-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237070a0' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
.input-wrap select option { background: #1e1e3a; color: var(--white); }
.input-wrap textarea {
  resize: vertical;
  min-height: 90px;
}
.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--input-focus);
  background: #20204a;
}
.input-wrap input::placeholder,
.input-wrap textarea::placeholder { color: var(--text-muted); opacity: .7; }
.input-icon {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color var(--transition);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
.input-icon:hover { color: var(--white); }
.input-wrap input[type="password"],
.input-wrap input.has-icon { padding-right: 42px; }

/* Two columns */
.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== CHECKBOX / RADIO ===== */
.auth-check-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.auth-check-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.08);
  background: var(--input-bg);
  font-size: .82rem;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.auth-check:hover { border-color: rgba(91,76,255,.4); background: rgba(91,76,255,.08); }
.auth-check input[type="checkbox"] {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,.2);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  padding: 0;
}
.auth-check input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.auth-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px;
  width: 5px; height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.auth-check.checked { border-color: var(--primary); background: rgba(91,76,255,.12); color: var(--white); }

/* Single consent checkbox */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  margin-bottom: 16px;
}
.auth-consent input[type="checkbox"] {
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,.2);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  padding: 0;
}
.auth-consent input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
.auth-consent input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px;
  width: 5px; height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.auth-consent-text { font-size: .78rem; color: var(--text-muted); line-height: 1.6; }
.auth-consent-text a { color: var(--primary-light); text-decoration: none; }
.auth-consent-text a:hover { color: var(--white); }

/* ===== REMEMBER ME ROW ===== */
.auth-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text-muted);
}
.remember-label input[type="checkbox"] {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,.2);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
  padding: 0;
}
.remember-label input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
.remember-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 4px; height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.auth-link {
  color: var(--primary-light);
  font-size: .82rem;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.auth-link:hover { color: var(--white); }

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.strength-title {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.strength-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.strength-list li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .76rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.strength-list li::before { content: '○'; font-size: .7rem; }
.strength-list li.valid   { color: var(--success); border-color: rgba(67,233,123,.3); background: rgba(67,233,123,.08); }
.strength-list li.valid::before { content: '✓'; }
.strength-list li.invalid { color: var(--error); border-color: rgba(255,107,107,.25); }
.strength-list li.invalid::before { content: '✕'; font-size: .65rem; }

/* ===== BTN SUBMIT ===== */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-size: .95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 8px 24px rgba(91,76,255,.4);
  outline: none;
  margin-bottom: 16px;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(91,76,255,.55); }
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ===== FOOTER LINKS ===== */
.auth-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-muted);
}
.auth-footer-links a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.auth-footer-links a:hover { color: var(--white); }
.auth-footer-links .sep { color: rgba(255,255,255,.15); }

.auth-switch {
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 20px;
}
.auth-switch a {
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}
.auth-switch a:hover { color: var(--white); }

/* ===== TOAST / ALERT ===== */
.auth-toast-wrap {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100% - 48px);
}
.auth-toast {
  display: none;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  animation: toastIn .35s ease;
  font-size: .88rem;
}
.auth-toast.visible { display: flex; }
.auth-toast.toast-success { border-color: rgba(67,233,123,.3); }
.auth-toast.toast-error   { border-color: rgba(255,107,107,.3); }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-body strong { display: block; font-size: .85rem; margin-bottom: 2px; }
.toast-body span { color: var(--text-muted); }
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color var(--transition);
}
.toast-close:hover { color: var(--white); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== PAGE FOOTER ===== */
.auth-page-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  font-size: .78rem;
  color: var(--text-muted);
}
.auth-page-footer a { color: var(--primary-light); text-decoration: none; }
.auth-page-footer a:hover { color: var(--white); }

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .auth-card { padding: 28px 20px 24px; }
  .auth-row  { grid-template-columns: 1fr; }
  .auth-check-wrap { gap: 8px; }
}
