/* Thunder EV — Premium full-panel customer onboarding */

.tev-onboard {
  font-family: 'Inter', 'Poppins', system-ui, sans-serif;
  overflow-x: hidden;
}

/* —— Split layout: 50/50 desktop, 45/55 tablet, stack mobile —— */
.tev-onboard__grid {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  width: 100%;
}

.tev-onboard-hero,
.tev-onboard-panel {
  flex: 1 1 auto;
  min-height: 0;
}

@media (min-width: 768px) {
  .tev-onboard__grid {
    flex-direction: row;
  }

  .tev-onboard-hero {
    flex: 0 0 45%;
    width: 45%;
    max-width: 45%;
    height: 100%;
    min-height: 100dvh;
  }

  .tev-onboard-panel {
    flex: 0 0 55%;
    width: 55%;
    max-width: 55%;
    height: 100%;
    min-height: 100dvh;
  }
}

@media (min-width: 1024px) {
  .tev-onboard-hero {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
  }

  .tev-onboard-panel {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
  }
}

/* —— Left hero —— */
.tev-onboard-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.tev-onboard-hero > .absolute.inset-0 {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.tev-onboard-hero > .relative.z-10 {
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
}

.tev-onboard-hero .brand-thunder {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tev-onboard-hero .brand-ev {
  color: #ff6600 !important;
}

.tev-onboard-hero__mesh {
  pointer-events: none;
  opacity: 0.55;
  background-color: rgba(15, 23, 42, 0.25);
  background-image:
    radial-gradient(ellipse 120% 100% at 0% 0%, rgba(255, 102, 0, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 110% 95% at 100% 100%, rgba(59, 130, 246, 0.32) 0%, transparent 58%),
    radial-gradient(ellipse 90% 80% at 50% 50%, rgba(6, 182, 212, 0.18) 0%, transparent 65%),
    linear-gradient(165deg, rgba(29, 78, 216, 0.22) 0%, rgba(15, 23, 42, 0.08) 42%, rgba(255, 102, 0, 0.14) 100%),
    repeating-linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.045) 0,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 36px
    );
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}

.tev-trust-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

/* —— Right: full-height auth workspace —— */
.tev-onboard-panel {
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #f8fafc 0%, #ffffff 38%, #f1f5f9 100%);
  border-left: 1px solid #e2e8f0;
  overflow: hidden;
}

.tev-auth-mobile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.tev-auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.tev-auth-panel__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 3.75rem) clamp(1.5rem, 5vw, 3.75rem) clamp(1.25rem, 3vh, 2rem);
}

/* —— Home: fixed top-right (all breakpoints) —— */
.tev-auth-home-corner {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  z-index: 100;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.tev-recovery-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tev-recovery-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.12);
}

.tev-recovery-card__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.tev-recovery-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tev-recovery-card__body strong {
  font-size: 0.9rem;
  color: #0f172a;
}

.tev-recovery-card__body span {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.35;
}

/* —— Premium pill tabs —— */
.tev-auth-tabs {
  position: relative;
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
  padding: 0.35rem;
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
  background: #e2e8f0;
  border-radius: 999px;
  max-width: 28rem;
  width: 100%;
}

.tev-auth-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  font-weight: 700;
  color: #64748b;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.tev-auth-tab:hover:not(.active) {
  color: #334155;
}

.tev-auth-tab.active {
  color: #fff;
}

.tev-auth-tabs__indicator {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 0.35rem;
  width: calc(50% - 0.35rem);
  border-radius: 999px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #ff6600 120%);
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.35);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

body[data-hub-mode="login"] .tev-auth-tabs__indicator {
  transform: translateX(100%);
}

/* —— Scrollable auth body (top-aligned — no field overlap) —— */
.tev-auth-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scroll-behavior: smooth;
}

.tev-auth-content {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 0 1.5rem;
}

body[data-hub-mode="login"] .tev-panel-head--shared,
body[data-hub-mode="login"] #cr-progress {
  display: none !important;
}

body[data-hub-mode="register"] .tev-login-intro {
  display: none !important;
}

.tev-login-intro {
  margin: 0 0 1.5rem;
  padding-top: 0.25rem;
}

body[data-hub-mode="login"] .tev-auth-tabs {
  margin-bottom: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 12;
  background: linear-gradient(180deg, #f8fafc 85%, rgba(248, 250, 252, 0));
  padding-bottom: 0.35rem;
}

body[data-hub-mode="login"] .tev-auth-form {
  scroll-margin-top: 6rem;
}

body[data-hub-mode="login"] .tev-auth-form .tev-input:first-of-type,
body[data-hub-mode="register"] .tev-auth-form .tev-input:first-of-type {
  scroll-margin-top: 5rem;
}

.tev-panel-head {
  margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
}

.tev-panel-head__title {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

.tev-panel-head__lead {
  margin: 0.5rem 0 0;
  font-size: clamp(0.875rem, 1.6vw, 1rem);
  color: #64748b;
  line-height: 1.5;
}

/* —— View fade (register ↔ login) —— */
.tev-auth-views {
  display: grid;
  grid-template: 1fr / 1fr;
  width: 100%;
}

.tev-auth-view {
  grid-area: 1 / 1;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    visibility 0.4s;
}

.tev-auth-view--active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  z-index: 1;
  position: relative;
}

/* —— Form: 85% width, enterprise spacing —— */
.tev-auth-form {
  width: 88%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

@media (min-width: 768px) {
  .tev-auth-form {
    width: 90%;
  }
}

.tev-reg-step {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tev-reg-step.tev-hidden {
  display: none !important;
}

.tev-progress {
  width: 88%;
  margin: 0 auto 1.25rem;
}

@media (min-width: 768px) {
  .tev-progress {
    width: 90%;
  }
}

.tev-progress__track {
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tev-progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d4ed8, #ff6600);
  transition: width 0.35s ease;
}

.tev-progress__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
}

.tev-progress [data-step-indicator].active {
  color: #1d4ed8;
}

.tev-progress [data-step-indicator].done {
  color: #16a34a;
}

.tev-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.4rem;
}

.tev-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  color: #0f172a;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.tev-input:hover {
  border-color: #94a3b8;
}

.tev-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.tev-field-wrap {
  display: flex;
  flex-direction: column;
}

.tev-field-hint {
  margin: 0.35rem 0 0;
  min-height: 1rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #64748b;
}

.tev-field-hint--ok {
  color: #16a34a;
  font-weight: 600;
}

.tev-field-hint--err {
  color: #dc2626;
  font-weight: 600;
}

.tev-input.tev-input--valid {
  border-color: #22c55e;
}

.tev-input.tev-input--valid:focus {
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.tev-input.tev-input--invalid {
  border-color: #ef4444;
}

.tev-input.tev-input--invalid:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.tev-skip-step {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.tev-skip-step:hover {
  color: #1d4ed8;
}

.tev-reset-modal {
  position: relative;
}

.tev-reset-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}

.tev-reset-close:hover {
  color: #0f172a;
}

#cr-reset-modal.active {
  display: flex;
}

.tev-reset-success-box {
  text-align: center;
  padding: 0.5rem 0;
}

.tev-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.tev-chip:hover {
  border-color: #93c5fd;
}

.tev-chip:has(input:checked) {
  background: linear-gradient(135deg, #eff6ff, #fff7ed);
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.tev-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tev-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 88%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .tev-interests {
    width: 90%;
  }
}

.tev-chip--all {
  font-weight: 800;
  border-style: dashed;
}

.tev-chip--all:has(input:checked) {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.tev-chip--all:has(input:checked) input {
  accent-color: #fff;
}

.tev-interests-summary {
  width: 88%;
  margin: 0.65rem auto 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  min-height: 1.1rem;
}

@media (min-width: 768px) {
  .tev-interests-summary {
    width: 90%;
  }
}

.tev-reg-nav {
  width: 88%;
  margin: 0.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .tev-reg-nav {
    width: 90%;
  }
}

.tev-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #1e40af 100%);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(29, 78, 216, 0.35);
  transition: transform 0.2s ease, box-shadow 0.25s ease, opacity 0.2s;
}

.tev-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.42);
}

.tev-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.tev-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.tev-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.tev-btn-secondary:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.tev-btn-ghost {
  background: transparent;
  border: none;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.tev-btn-ghost:hover {
  color: #1d4ed8;
}

.tev-social-btn {
  padding: 0.65rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.tev-social-btn:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.tev-register-status {
  width: 88%;
  margin: 0.75rem auto 0;
  font-size: 0.875rem;
  min-height: 1.25rem;
}

@media (min-width: 768px) {
  .tev-register-status {
    width: 90%;
  }
}

.tev-register-status--err {
  color: #dc2626;
  font-weight: 600;
}

.tev-register-status--ok {
  color: #16a34a;
  font-weight: 600;
}

.tev-security-badges {
  list-style: none;
  margin: 1.5rem auto 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  width: 88%;
  font-size: 0.7rem;
  color: #64748b;
}

@media (min-width: 768px) {
  .tev-security-badges {
    width: 90%;
  }
}

body[data-hub-mode="login"] .tev-security-badges--register,
body[data-hub-mode="login"] #cr-progress {
  display: none !important;
}

body[data-hub-mode="register"] .tev-security-badges--login {
  display: none !important;
}

.tev-hidden {
  display: none !important;
}

/* Login panel extras */
#cr-login-panel .tev-auth-form + .relative {
  width: 88%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  #cr-login-panel .tev-auth-form + .relative {
    width: 90%;
  }
}

#cr-login-panel .grid.grid-cols-3 {
  width: 88%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  #cr-login-panel .grid.grid-cols-3 {
    width: 90%;
  }
}

#cr-login-panel details {
  width: 88%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  #cr-login-panel details {
    width: 90%;
  }
}

/* Success modal */
.success-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

.success-popup-overlay.active {
  display: flex;
  animation: tevFadeIn 0.25s ease;
}

.tev-success-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 1.25rem;
  padding: 1.75rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
  text-align: center;
  animation: tevScaleIn 0.35s ease;
}

@keyframes tevFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tevScaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-height: 700px) and (min-width: 1024px) {
  .tev-onboard-hero .tev-hero-gallery {
    display: none;
  }

  .tev-auth-scroll {
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  .tev-onboard__grid {
    height: auto;
    min-height: 100dvh;
  }

  .tev-onboard-panel {
    min-height: 60vh;
  }

  .tev-auth-tabs {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-float-slow,
  .animate-fade-up,
  .tev-auth-view,
  .tev-auth-tabs__indicator,
  .tev-input:focus {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
