/* =============================================================================
   MegaCity — modules/auth/css/auth.css
   Styles for all auth pages: login, register, reset
   ============================================================================= */

/* ─── Auth container (full-viewport split layout) ───────────────────────────── */
.auth-container {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* ─── Left visual panel ──────────────────────────────────────────────────────── */
.auth-visual {
  display: flex;
  flex: 0 0 50%;
  width: 50%;
  background: var(--primary-gradient, linear-gradient(135deg, #3b82f6, #1d4ed8));
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

/* Decorative pseudo-elements */
.auth-visual::before,
.auth-visual::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  pointer-events: none;
}
.auth-visual::before {
  width: 500px;
  height: 500px;
  top: -200px;
  right: -150px;
}
.auth-visual::after {
  width: 350px;
  height: 350px;
  bottom: -120px;
  left: -100px;
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 40px 48px;
  max-width: 440px;
}

.auth-visual-svg {
  margin-bottom: 32px;
}
.auth-visual-svg svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.18));
}

.auth-visual-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.5px;
  margin-bottom: 12px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.auth-visual-tagline {
  font-size: .95rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ─── Animated decorative dots ──────────────────────────────────────────────── */
.auth-visual-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.auth-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  animation: auth-dot-pulse 2s ease-in-out infinite;
}
.auth-dot--1 { animation-delay: 0s;    background: rgba(255,255,255,.7); }
.auth-dot--2 { animation-delay: .35s;  background: rgba(255,255,255,.5); }
.auth-dot--3 { animation-delay: .7s;   background: rgba(255,255,255,.35); }

@keyframes auth-dot-pulse {
  0%, 100% { transform: scale(1);   opacity: .6; }
  50%       { transform: scale(1.4); opacity: 1;  }
}

/* ─── Right form panel ───────────────────────────────────────────────────────── */
.auth-form-panel {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
  background-color: var(--bg-body, #f8fafc);
  transition: background-color .25s ease;
}

/* Dark mode adaptation */
[data-dark="1"] .auth-form-panel {
  background-color: #0f172a;
}

/* ─── Form container ─────────────────────────────────────────────────────────── */
.auth-form-container {
  width: 100%;
  max-width: 420px;
}

/* Wider variant for register (more fields) */
.auth-form-container--wide {
  max-width: 480px;
}

/* ─── Entry animation ────────────────────────────────────────────────────────── */
@keyframes auth-fade-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-fade-in {
  animation: auth-fade-in .45s cubic-bezier(.22,.68,0,1.2) both;
}

/* ─── Logo mark ──────────────────────────────────────────────────────────────── */
.auth-logo-mark {
  margin-bottom: 8px;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient, linear-gradient(135deg, #3b82f6, #1d4ed8));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb, 59,130,246), .3);
}

.auth-logo-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  letter-spacing: -.25px;
}

[data-dark="1"] .auth-logo-name {
  color: #f1f5f9;
}

/* ─── Form headings ──────────────────────────────────────────────────────────── */
.auth-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  letter-spacing: -.4px;
  margin-bottom: 4px;
}

.auth-form-subtitle {
  font-size: .875rem;
  color: var(--text-secondary, #64748b);
  margin-bottom: 24px;
}

[data-dark="1"] .auth-form-title {
  color: #f1f5f9;
}

/* ─── Form controls ──────────────────────────────────────────────────────────── */
.form-label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-primary, #0f172a);
  margin-bottom: 6px;
}

[data-dark="1"] .form-label {
  color: #cbd5e1;
}

.form-control,
.form-select {
  border-color: var(--border-color, #e2e8f0);
  border-radius: var(--border-radius-sm, 8px);
  padding: .5rem .75rem;
  font-size: .9375rem;
  color: var(--text-input, #0f172a);
  background-color: var(--bg-input, #fff);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 59,130,246), .15);
  outline: none;
}

[data-dark="1"] .form-control,
[data-dark="1"] .form-select {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-dark="1"] .form-control:focus,
[data-dark="1"] .form-select:focus {
  border-color: var(--primary, #3b82f6);
  background-color: #1e293b;
}

[data-dark="1"] .form-control::placeholder {
  color: #475569;
}

/* Input groups */
.input-group-text {
  background-color: var(--bg-input, #fff);
  border-color: var(--border-color, #e2e8f0);
  color: var(--text-secondary, #64748b);
  font-size: .9rem;
}

[data-dark="1"] .input-group-text {
  background-color: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

/* ─── Submit button ──────────────────────────────────────────────────────────── */
.auth-submit-btn {
  padding: .625rem 1.5rem;
  font-weight: 600;
  font-size: .9375rem;
  border-radius: var(--border-radius-sm, 8px);
  background: var(--primary-gradient, linear-gradient(135deg, #3b82f6, #1d4ed8));
  border: none;
  transition: opacity .2s ease, transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb, 59,130,246), .35);
}

.auth-submit-btn:hover:not(:disabled) {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb, 59,130,246), .45);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb, 59,130,246), .3);
}

.auth-submit-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* ─── Footer links ───────────────────────────────────────────────────────────── */
.auth-links {
  text-align: center;
  margin-top: 24px;
  font-size: .875rem;
  color: var(--text-secondary, #64748b);
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.auth-link {
  color: var(--primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s ease;
}

.auth-link:hover {
  color: var(--primary-dark, #2563eb);
  text-decoration: underline;
}

/* ─── Password strength bar ──────────────────────────────────────────────────── */
.password-strength-bar {
  display: flex;
  gap: 4px;
  height: 5px;
}

.strength-segment {
  flex: 1;
  border-radius: 4px;
  background-color: var(--border-color, #e2e8f0);
  transition: background-color .3s ease;
}

/* Strength levels applied via JS data-strength on parent */
.password-strength-bar[data-strength="1"] .strength-segment[data-index="0"] {
  background-color: #ef4444;
}
.password-strength-bar[data-strength="2"] .strength-segment[data-index="0"],
.password-strength-bar[data-strength="2"] .strength-segment[data-index="1"] {
  background-color: #f59e0b;
}
.password-strength-bar[data-strength="3"] .strength-segment[data-index="0"],
.password-strength-bar[data-strength="3"] .strength-segment[data-index="1"],
.password-strength-bar[data-strength="3"] .strength-segment[data-index="2"] {
  background-color: #f97316;
}
.password-strength-bar[data-strength="4"] .strength-segment {
  background-color: #10b981;
}

.password-strength-label {
  font-size: .78rem;
  font-weight: 500;
  min-height: 1.2em;
  transition: color .25s ease;
}
.strength-text--1 { color: #ef4444; }
.strength-text--2 { color: #f59e0b; }
.strength-text--3 { color: #f97316; }
.strength-text--4 { color: #10b981; }

/* ─── Password requirements list ─────────────────────────────────────────────── */
.password-requirements {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .8rem;
  color: var(--text-secondary, #64748b);
}

.password-requirements .req {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  transition: color .2s ease;
}

.req-icon {
  font-size: .7rem;
  transition: color .2s ease;
}

.req-icon--fail  { color: var(--text-muted, #94a3b8); }
.req-icon--pass  { color: #10b981; }

.req--pass {
  color: #10b981;
  text-decoration: line-through;
  text-decoration-color: rgba(16,185,129,.4);
}
.req--pass .req-icon { font-size: .85rem; }

/* ─── Username / Email real-time feedback ────────────────────────────────────── */
.username-feedback,
.email-feedback {
  font-size: .8rem;
  min-height: 1.2em;
  transition: color .2s ease;
}
.feedback--available { color: #10b981; }
.feedback--taken     { color: #ef4444; }
.feedback--checking  { color: var(--text-secondary, #64748b); }

/* ─── Phone code field ───────────────────────────────────────────────────────── */
.phone-code-field {
  animation: auth-fade-in .3s ease both;
}

.dial-code-select {
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* ─── Flash messages ─────────────────────────────────────────────────────────── */
.flash-messages {
  margin-bottom: 20px;
}

/* ─── Helper: text-sm ────────────────────────────────────────────────────────── */
.text-sm  { font-size: .8125rem !important; }
.text-xs  { font-size: .75rem !important; }

/* ─── Responsive: hide visual panel on mobile ────────────────────────────────── */
@media (max-width: 767.98px) {
  .auth-visual {
    display: none;
  }

  .auth-form-panel {
    flex: 1 1 100%;
    width: 100%;
    min-height: 100vh;
    padding: 32px 20px;
  }

  .auth-form-container,
  .auth-form-container--wide {
    max-width: 100%;
  }

  .auth-form-title { font-size: 1.375rem; }
}

/* ─── Medium screens: slightly narrower visual ───────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .auth-visual { flex: 0 0 42%; width: 42%; }
  .auth-form-panel { flex: 1 1 58%; }
  .auth-visual-content { padding: 32px 28px; }
}

/* ─── Input password toggle button ──────────────────────────────────────────── */
.input-password-toggle {
  border-color: var(--border-color, #e2e8f0);
  color: var(--text-secondary, #64748b);
  background-color: var(--bg-input, #fff);
}

.input-password-toggle:hover {
  background-color: var(--primary-light, #dbeafe);
  border-color: var(--primary, #3b82f6);
  color: var(--primary-dark, #2563eb);
}

[data-dark="1"] .input-password-toggle {
  background-color: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

[data-dark="1"] .input-password-toggle:hover {
  background-color: #1e293b;
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
}

/* ─── Form-check styling ─────────────────────────────────────────────────────── */
.form-check-input:checked {
  background-color: var(--primary, #3b82f6);
  border-color: var(--primary, #3b82f6);
}

.form-check-input:focus {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 59,130,246), .15);
}

.form-check-label {
  font-size: .875rem;
  color: var(--text-secondary, #64748b);
}

[data-dark="1"] .form-check-label {
  color: #94a3b8;
}

/* ─── Dropdown select fix in dark mode ───────────────────────────────────────── */
[data-dark="1"] select option {
  background-color: #1e293b;
  color: #f1f5f9;
}

/* ─── Multi-step register: progress nav ─────────────────────────────────────── */
.register-steps-nav {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             0;
}

.reg-step {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4px;
  cursor:         default;
}

.reg-step-num {
  width:          32px;
  height:         32px;
  border-radius:  50%;
  border:         2px solid #dee2e6;
  background:     #fff;
  color:          #94a3b8;
  font-size:      .8rem;
  font-weight:    700;
  display:        flex;
  align-items:    center;
  justify-content: center;
  transition:     all .3s;
}

.reg-step span {
  font-size:   .7rem;
  color:       #94a3b8;
  font-weight: 500;
  transition:  color .3s;
}

.reg-step.active .reg-step-num {
  background:  var(--primary, #3b82f6);
  border-color: var(--primary, #3b82f6);
  color:       #fff;
  box-shadow:  0 0 0 4px rgba(var(--primary-rgb, 59,130,246), .15);
}

.reg-step.active span {
  color: var(--primary, #3b82f6);
  font-weight: 600;
}

.reg-step.done .reg-step-num {
  background:  #10b981;
  border-color: #10b981;
  color:       #fff;
}

.reg-step.done .reg-step-num::before {
  content: '✓';
}

.reg-step-connector {
  flex:         1;
  height:       2px;
  background:   #dee2e6;
  margin:       0 8px;
  margin-bottom: 20px;
  min-width:    40px;
  transition:   background .3s;
}

.reg-step.done ~ .reg-step-connector,
.reg-step-connector.done {
  background: #10b981;
}

/* Step content panels */
.reg-step-content {
  display: none;
}

.reg-step-content.active {
  display: block;
  animation: stepFadeIn .3s ease;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Step dots on the visual panel ─────────────────────────────────────────── */
.auth-steps-visual {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             0;
}

.auth-step-dot {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4px;
}

.auth-step-dot span {
  width:           28px;
  height:          28px;
  border-radius:   50%;
  background:      rgba(255,255,255,.25);
  color:           rgba(255,255,255,.7);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       .78rem;
  font-weight:     700;
  transition:      all .3s;
}

.auth-step-dot small {
  font-size:  .65rem;
  color:      rgba(255,255,255,.6);
  transition: color .3s;
}

.auth-step-dot.active span {
  background: rgba(255,255,255,.95);
  color:      var(--primary, #3b82f6);
  box-shadow: 0 0 0 4px rgba(255,255,255,.25);
}

.auth-step-dot.active small {
  color: #fff;
  font-weight: 600;
}

.auth-step-line {
  flex:       1;
  height:     2px;
  background: rgba(255,255,255,.3);
  min-width:  36px;
  margin:     0 6px;
  margin-bottom: 16px;
}

/* ─── Submit button centered ─────────────────────────────────────────────────── */
.auth-submit-btn {
  font-weight: 600;
  letter-spacing: .01em;
  padding:   12px 20px;
}

/* Fix Bootstrap btn-primary text alignment */
.btn.auth-submit-btn .btn-label {
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         8px;
  width:       100%;
}
