/* =========================================================================
   AUTH.CSS — Unified styles for Login & Register dialogs
   ========================================================================= */

/* Hide webkit scrollbars inside dialogs */
::-webkit-scrollbar { display: none; }

/* Base */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0f0b15;
  color: #eee;
  font: 500 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
}
/* Dialog container */
#LoginDialog, #RegisterDialog {
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92dvw, 680px);
  max-height: 90vh;
  border: none;
  background: transparent;
  padding: 0; /* we’ll pad the form, not the dialog */
}




/* ---------- Dialogs (centered, consistent) ---------- */

#LoginDialog::backdrop,
#RegisterDialog::backdrop {
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}

/* Logo in dialogs */
#LoginDialog #AuthLogo,
#RegisterDialog #AuthLogo,
#LoginLogo, #RegisterLogo {
  display: block;
  width: min(150px, 36vw);
  height: auto;
  margin: 20px auto 10px;
  filter: drop-shadow(0 0 6px rgba(124,58,237,0.5));
}

/* ---------- Auth Form Shell ---------- */

.auth-form {
  background: #17121f;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 18px 48px rgba(0,0,0,.5);
  margin: 2% auto;
  padding: 4% 5%;  
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* entry animations */
.auth-form.animate-success { animation: formSuccess 0.6s ease; }
.auth-form.animate-failure { animation: formFail 0.3s ease; }

/* Section / Step mechanics */
.form-section,
.login-step,
.reg-step { display: none; }
.form-section.active,
.login-step.active,
.reg-step.active { display: block; }

/* Headings */
.form-section h2,
.login-step h2,
.reg-step h2 {
  margin: 0 0 6px 0;
  font-size: 1.5rem;
}
.muted { color: #bfb8d4; margin-top: -2px; }

/* ---------- Fields ---------- */
.form-group { margin: 14px 0; width: 100%; }
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: #e8e6f2;
}
/* Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="file"] {
  display: block;
  width: 98%;    
  padding: 0.6em 0.8em;
  border-radius: 0.5em;
  border: 1px solid rgba(255,255,255,.14);
  background: #1e1929;
  color: #eee;
  font-size: 1rem;
  box-sizing: border-box; 
}

/* Inputs on focus */
.form-group input:focus {
  border-color: #7c3aed;
  outline: none;
  box-shadow: 0 0 0 0.25em rgba(124,58,237,.25);
}
.field-feedback {
  display: block;
  font-size: 12px;
  color: #bfb8d4;
  margin-top: 6px;
}

/* Two-column rows (collapse on small) */
.form-row { display: grid; gap: 12px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form-row.two { grid-template-columns: 1fr; } }

/* ---------- Avatar upload ---------- */
.avatar-upload {
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  align-items: center;
}
.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.2);
  background: #120d1c;
}

/* ---------- Password meter + requirements ---------- */
.pw-meter {
  height: 8px;
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  margin: 8px 0 10px;
  overflow: hidden;
}
.pw-meter #pwFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,#ef4444,#f59e0b,#22c55e);
  transition: width .2s ease;
}
#password-requirements {
  list-style: none;
  padding-left: 0;
  margin-top: 4px;
  font-size: 13px;
  color: #bfb8d4;
}
#password-requirements li { color: #aaa; }
#password-requirements li.valid { color: #22c55e; }

/* ---------- Controls / Buttons ---------- */
.form-controls {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}
button {
  appearance: none;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
button.primary {
  color: #fff;
  background: linear-gradient(90deg,#7c3aed,#d946ef);
  box-shadow: 0 6px 16px rgba(124,58,237,.25);
}
button.secondary {
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.auth-form button[type="submit"] { font-size: 1rem; }

/* ---------- Error / success text ---------- */
.error-text {
  color: #f44336;
  font-size: 0.9rem;
  margin-top: 8px;
  transition: opacity 0.3s ease;
}
.error-text.fade-out { opacity: 0; }

/* ---------- Auth links (under forms) ---------- */
.auth-links {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 6px;
}
.auth-links p { margin: 4px 0 10px; }
.auth-links a.auth-link {
  color: #7c3aed;
  text-decoration: none;
}
.auth-links a.auth-link:hover { text-decoration: underline; }

/* ---------- Identity pill (login step 2) ---------- */
.pill {
  display: inline-block;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  padding: 6px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #eae7f5;
}

/* ---------- Legacy selectors kept for compatibility ---------- */
.form-section { display: none; flex-direction: column; align-items: flex-start; gap: 12px; }
.form-section.active { display: flex; }

/* ---------- Animations ---------- */
@keyframes formSuccess {
  0%   { box-shadow: 0 0 0px 0 #28a745; }
  50%  { box-shadow: 0 0 10px 5px #28a745aa; }
  100% { box-shadow: 0 0 0px 0 #28a745; }
}
@keyframes formFail {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-5px); }
  50%  { transform: translateX(5px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}