/* ═══════════════════════════════════════
   AUTH PAGES — Modern Two-Panel Layout
   ═══════════════════════════════════════ */

:root {
  --auth-accent:      #3d3dc7;
  --auth-accent-hi:   #5050d8;
  --auth-accent-low:  #2d2dab;
  --auth-bg-deep:     #0a0a14;
  --auth-bg-card:     #14141f;
  --auth-bg-input:    #1d1d2c;
  --auth-border:      #2a2a40;
  --auth-text:        #e8e8ff;
  --auth-text-dim:    #8888aa;
  --auth-text-faint:  #555575;
}

/* ── Body ── */
html, body {
  overflow: auto !important;
  height: auto !important;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 800px 600px at 50% 50%,
      rgba(61, 61, 199, 0.04) 0%, transparent 60%),
    var(--auth-bg-deep) !important;
}

body.auth-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Pattern overlay (subtle texture) ── */
body.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(61, 61, 199, 0.025) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(61, 61, 199, 0.025) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Main content area ── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════
   CARD CONTAINER (Two-panel layout)
   ═══════════════════════════════════════ */
.auth-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 940px;
  min-height: 620px;
  background: var(--auth-bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(61, 61, 199, 0.08);
  animation: cardSlide 0.4s ease;
}

@keyframes cardSlide {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── LEFT: Image panel ── */
.auth-img {
  position: relative;
  background: #1a1a28;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.88);
}

.auth-img-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 40%, rgba(61, 61, 199, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(180, 30, 60, 0.3) 0%, transparent 60%),
    linear-gradient(135deg, #1a1a28, #0d0d18);
  color: var(--auth-accent);
  font-size: 80px;
  text-shadow: 0 0 60px rgba(61, 61, 199, 0.6);
}

/* ── RIGHT: Form panel ── */
.auth-form {
  padding: 48px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--auth-bg-card);
}

/* ── Welcome badge ── */
.auth-badge {
  align-self: center;
  display: inline-block;
  padding: 5px 16px;
  background: rgba(61, 61, 199, 0.15);
  border: 1px solid rgba(61, 61, 199, 0.35);
  color: var(--auth-accent-hi);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 4px;
  margin-bottom: 16px;
}

/* ── Title ── */
.auth-title {
  font-size: 38px;
  font-weight: 800;
  text-align: center;
  color: var(--auth-text);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* ── Subtitle ── */
.auth-sub {
  text-align: center;
  font-size: 13px;
  color: var(--auth-text-dim);
  line-height: 1.55;
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════
   FORM FIELDS
   ═══════════════════════════════════════ */
.auth-field {
  margin-bottom: 14px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--auth-text);
  margin-bottom: 6px;
}

.auth-label-optional {
  color: var(--auth-text-faint);
  font-weight: 500;
  font-style: italic;
  margin-left: 4px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--auth-accent);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--auth-bg-input);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  color: var(--auth-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input::placeholder {
  color: var(--auth-text-faint);
}

.auth-input:focus {
  border-color: var(--auth-accent);
  background: #21212f;
  box-shadow: 0 0 0 3px rgba(61, 61, 199, 0.15);
}

.auth-input:hover:not(:focus) {
  border-color: #3a3a55;
}

/* Password fields with eye toggle */
.auth-input-pass {
  padding-right: 42px;
}

.auth-pass-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--auth-accent);
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.auth-pass-toggle:hover {
  color: var(--auth-accent-hi);
  background: rgba(61, 61, 199, 0.1);
}

/* ── Two-column field row ── */
.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Error / Hint ── */
.auth-error {
  color: #ff5555;
  font-size: 12px;
  min-height: 16px;
  margin-top: 4px;
}

.auth-hint {
  color: var(--auth-text-faint);
  font-size: 11px;
  margin-top: 4px;
}

/* ═══════════════════════════════════════
   SUBMIT BUTTON
   ═══════════════════════════════════════ */
.auth-submit {
  width: 100%;
  padding: 14px 20px;
  margin-top: 14px;
  background: linear-gradient(135deg, #d92d4a, #b41e3c);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(217, 45, 74, 0.3);
}

.auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #e83a57, #c12849);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(217, 45, 74, 0.4);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-submit-arrow {
  font-size: 16px;
  transition: transform 0.2s;
}

.auth-submit:hover:not(:disabled) .auth-submit-arrow {
  transform: translateX(3px);
}

/* ── Alt accent variant (blue) ── */
.auth-submit-blue {
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-low));
  box-shadow: 0 4px 16px rgba(61, 61, 199, 0.3);
}

.auth-submit-blue:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--auth-accent-hi), var(--auth-accent));
  box-shadow: 0 6px 24px rgba(61, 61, 199, 0.4);
}

/* ═══════════════════════════════════════
   BOTTOM LINK
   ═══════════════════════════════════════ */
.auth-bottom {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--auth-text-dim);
}

.auth-bottom-link {
  color: #ffcc44;
  text-decoration: none;
  font-weight: 700;
  margin-left: 4px;
  transition: color 0.2s;
}

.auth-bottom-link:hover {
  color: #ffd866;
  text-decoration: underline;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.auth-footer {
  padding: 24px 20px 32px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.auth-footer-link {
  color: var(--auth-text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-footer-link:hover {
  color: var(--auth-accent-hi);
}

.auth-footer-divider {
  width: 1px;
  height: 12px;
  background: var(--auth-border);
}

.auth-footer-copy {
  font-size: 11px;
  color: var(--auth-text-faint);
  letter-spacing: 0.3px;
}

.auth-footer-copy span {
  color: var(--auth-accent-hi);
  font-weight: 600;
}

/* ═══════════════════════════════════════
   SPINNER
   ═══════════════════════════════════════ */
.auth-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 880px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 480px;
    min-height: auto;
  }

  .auth-img {
    height: 200px;
  }

  .auth-form {
    padding: 36px 32px 32px;
  }

  .auth-title {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .auth-main {
    padding: 20px 12px;
  }

  .auth-card {
    border-radius: 16px;
  }

  .auth-img {
    height: 160px;
  }

  .auth-form {
    padding: 28px 22px 24px;
  }

  .auth-title {
    font-size: 26px;
  }

  .auth-sub {
    font-size: 12px;
    margin-bottom: 20px;
  }

  .auth-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-footer-links {
    gap: 14px;
  }

  .auth-footer-divider {
    display: none;
  }
}