/* Immersive Split-View Auth Theme */
:root {
  --immersive-bg: #0f172a;
  --immersive-primary: #045227;
  --immersive-accent: #10b981;
  --immersive-text: #f8fafc;
  --immersive-text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(16px);
  --panel-width: 440px;
}

@media (prefers-color-scheme: light) {
  :root {
    --immersive-bg: #f8fafc;
    --immersive-text: #0f172a;
    --immersive-text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(15, 23, 42, 0.08);
  }
}

* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  background-color: var(--immersive-bg);
  color: var(--immersive-text);
}

.immersive-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* ─── Left Visual Panel ─── */
.visual-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px;
  background: radial-gradient(circle at top left, #064e3b, #0f172a);
}

.visual-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2v-4h4v-2h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2v-4h4v-2H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.visual-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.visual-logo {
  width: 140px;
  margin-bottom: 48px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
  animation: fadeInDown 0.8s ease-out;
}

.visual-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  color: #fff;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.visual-description {
  font-size: 1.25rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.trust-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.trust-avatars {
  display: flex;
}

.trust-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--immersive-bg);
  background: #334155;
  margin-left: -12px;
}

.trust-avatar:first-child { margin-left: 0; }

.trust-text {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* ─── Right Auth Panel ─── */
.auth-panel {
  width: var(--panel-width);
  min-width: var(--panel-width);
  background: var(--immersive-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  border-left: 1px solid var(--glass-border);
  position: relative;
  z-index: 10;
}

.auth-panel::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 200px;
  background: var(--immersive-primary);
  filter: blur(120px);
  opacity: 0.05;
  pointer-events: none;
}

.step-container {
  display: none;
  animation: fadeInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-container.active {
  display: block;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--immersive-primary);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.auth-subtitle {
  font-size: 1rem;
  color: var(--immersive-text-muted);
  line-height: 1.5;
  margin-bottom: 40px;
}

/* ─── Functional Elements ─── */
.btn-immersive {
  width: 100%;
  padding: 16px 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
}

.btn-primary-immersive {
  background: var(--immersive-primary);
  color: #fff;
  box-shadow: 0 10px 20px -5px rgba(4, 82, 39, 0.3);
}

.btn-primary-immersive:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(4, 82, 39, 0.4);
}

.btn-outline-immersive {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--immersive-text);
}

.btn-outline-immersive:hover {
  background: var(--glass-bg);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--glass-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  margin-bottom: 32px;
  transition: all 0.2s ease;
}

.checkbox-group:hover {
  border-color: var(--immersive-primary);
}

.checkbox-group input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--immersive-primary);
  cursor: pointer;
}

.checkbox-label {
  font-size: 14px;
  line-height: 1.5;
  color: var(--immersive-text-muted);
}

.checkbox-label a {
  color: var(--immersive-primary);
  text-decoration: none;
  font-weight: 700;
}

.auth-footer {
  margin-top: auto;
  padding-top: 40px;
  font-size: 14px;
  color: var(--immersive-text-muted);
}

.auth-footer a {
  color: var(--immersive-text);
  font-weight: 600;
  text-decoration: none;
}

/* ─── Loading State ─── */
.loading-panel {
  text-align: center;
}

.morph-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 32px;
  position: relative;
}

.morph-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--glass-border);
  border-top-color: var(--immersive-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.morph-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 36px;
  height: 36px;
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-logo {
  display: block;
  height: 4rem; /* 64px (desktop size) */
  width: auto;
  align-self: flex-start;
  margin-bottom: 40px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

/* ─── Mobile Responsiveness ─── */
@media (max-width: 1024px) {
  .visual-panel { display: none; }
  .auth-panel { width: 100%; min-width: 0; padding: 40px; border-left: none; }
  body { overflow: auto; }
  .auth-logo {
    height: 3.5rem; /* 56px (mobile size) */
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  .auth-panel { padding: 24px; }
}

/* ─── Form Controls & Layouts ─── */
.auth-grid {
  display: grid;
  gap: 20px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--immersive-primary);
  margin-bottom: 8px;
}

@media (prefers-color-scheme: dark) {
  .form-group label {
    color: var(--immersive-accent);
  }
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-label-row label {
  margin-bottom: 8px !important;
}

.auth-generate-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--immersive-primary);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  margin-bottom: 8px;
}

@media (prefers-color-scheme: dark) {
  .auth-generate-link {
    color: var(--immersive-accent);
  }
}

.auth-generate-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.auth-generate-link:active {
  transform: scale(0.94);
}

.auth-generate-link svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.auth-generate-link.spinning svg {
  animation: authGenSpin 0.52s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes authGenSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.auth-input-wrap {
  position: relative;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
}

.auth-input-icon svg {
  width: 18px;
  height: 18px;
}

.auth-panel input[type="text"],
.auth-panel input[type="email"],
.auth-panel input[type="password"] {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 16px 12px 42px; /* Extra left padding for icon */
  color: #0f172a;
  font-size: 15px;
  transition: all 0.2s ease;
}

.auth-panel input[type="text"]:focus,
.auth-panel input[type="email"]:focus,
.auth-panel input[type="password"]:focus {
  outline: none;
  border-color: var(--immersive-primary);
  box-shadow: 0 0 0 4px rgba(4, 82, 39, 0.05);
}

@media (prefers-color-scheme: dark) {
  .auth-panel input[type="text"],
  .auth-panel input[type="email"],
  .auth-panel input[type="password"] {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
  }
  .auth-panel input[type="text"]:focus,
  .auth-panel input[type="email"]:focus,
  .auth-panel input[type="password"]:focus {
    border-color: var(--immersive-accent);
  }
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 24px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
}

.auth-password-toggle svg {
  width: 16px;
  height: 16px;
}

.auth-link-row {
  text-align: right;
  margin-top: -10px;
}

.auth-link-row a {
  font-size: 13px;
  font-weight: 600;
  color: var(--immersive-primary);
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .auth-link-row a {
    color: var(--immersive-accent);
  }
}

.btn-primary {
  width: 100%;
  background: var(--immersive-primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(4, 82, 39, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(4, 82, 39, 0.3);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--immersive-text-muted);
  font-size: 13px;
  font-weight: 500;
  margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--glass-border);
}

.auth-divider:not(:empty)::before {
  margin-right: .75em;
}

.auth-divider:not(:empty)::after {
  margin-left: .75em;
}

.btn-google {
  width: 100%;
  padding: 14px;
  background: #ffffff;
  border: 1.5px solid var(--glass-border);
  border-radius: 12px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-google img {
  width: 18px;
  height: 18px;
}

