/* =====================
   AUTH PAGES
   Used by both login.html and signup.html
===================== */

/* Full-page split layout */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
  background: var(--white);
}

/* =====================
   LEFT PANEL — Brand
===================== */
.auth-left {
  background: var(--dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}

/* Subtle grid bg */
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(46,204,113,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,204,113,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Glow blob */
.auth-left::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,204,113,0.15) 0%, transparent 65%);
  bottom: -100px; right: -100px;
  pointer-events: none;
}

.auth-left-inner {
  position: relative;
  z-index: 1;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  text-decoration: none;
}

.auth-brand-logo img {
  width: 38px; height: 38px;
  object-fit: contain;
}

.auth-brand-logo span {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
}

.auth-brand-logo span em {
  color: var(--green);
  font-style: normal;
}

.auth-left h1 {
  font-family: var(--font-head);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.auth-left h1 span {
  color: var(--green);
}

.auth-left p {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  line-height: 1.75;
  margin-bottom: 40px;
  max-width: 380px;
}

/* Feature list */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-feature-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(46,204,113,0.12);
  border: 1px solid rgba(46,204,113,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.auth-feature-text {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}

/* =====================
   RIGHT PANEL — Form
===================== */
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
  overflow-y: auto;
  background: var(--white);
}

.auth-form-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

/* Mobile logo (shown only on mobile) */
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  text-decoration: none;
}

.auth-mobile-logo img {
  width: 32px; height: 32px;
  object-fit: contain;
}

.auth-mobile-logo span {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

/* Heading */
.auth-heading {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.auth-subheading {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 28px;
  line-height: 1.6;
}

.auth-subheading a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}

.auth-subheading a:hover {
  text-decoration: underline;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-2);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.12);
}

.auth-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.auth-input::placeholder { color: var(--text-3); }

/* Password toggle */
.auth-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 16px;
  padding: 2px;
  line-height: 1;
  transition: color 0.15s;
}

.auth-pw-toggle:hover { color: var(--text); }

/* Field error */
.auth-field-error {
  font-size: 12px;
  color: #ef4444;
  font-weight: 500;
  display: none;
}

.auth-field-error.show { display: block; }

/* =====================
   PASSWORD STRENGTH (signup only)
===================== */
.pw-strength-bar {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
  width: 0%;
}

.pw-strength-fill.weak   { width: 25%; background: #ef4444; }
.pw-strength-fill.fair   { width: 50%; background: #f59e0b; }
.pw-strength-fill.good   { width: 75%; background: #3b82f6; }
.pw-strength-fill.strong { width: 100%; background: var(--green); }

.pw-strength-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  margin-top: 3px;
}

/* =====================
   ROW (remember me / forgot)
===================== */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.auth-remember input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}

.auth-forgot {
  font-size: 13px;
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-forgot:hover { text-decoration: underline; }

/* =====================
   SUBMIT BUTTON
===================== */
.auth-submit {
  width: 100%;
  padding: 13px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 4px;
}

.auth-submit:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(46,204,113,0.3);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-submit .auth-spinner {
  width: 17px; height: 17px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.auth-submit.loading .auth-btn-text { display: none; }
.auth-submit.loading .auth-spinner  { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================
   ALERT BANNER
===================== */
.auth-alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.auth-alert.show { display: flex; }

.auth-alert.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-alert.success {
  background: var(--green-pale);
  color: var(--green-darker);
  border: 1px solid var(--green-muted);
}

.auth-alert-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* =====================
   DIVIDER
===================== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =====================
   TERMS (signup)
===================== */
.auth-terms {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
  margin-top: 4px;
}

.auth-terms a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-terms a:hover { text-decoration: underline; }

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 800px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-left { display: none; }

  .auth-right {
    min-height: 100vh;
    padding: 40px 24px;
    justify-content: flex-start;
    padding-top: 60px;
  }

  .auth-mobile-logo { display: flex; }

  .auth-form-wrap { max-width: 100%; }
}

@media (max-width: 400px) {
  .auth-right { padding: 40px 18px; }
}