@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-page: #09090b;
  --card-bg: #111115;
  --card-border: rgba(255, 255, 255, 0.08);
  --accent: #e2e8f0;
  --accent-secondary: #94a3b8;
  --text-muted: #64748b;
  --input-bg: #18181b;
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus: #e2e8f0;
  --danger-color: #f87171;
  --radius-card: 22px;
  --radius-input: 10px;
  --transition-smooth: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-page);
  color: var(--accent);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.auth-container {
  width: 100%;
  max-width: 820px;
  display: flex;
  justify-content: center;
}

/* Rounded Center Box Split in Two */
.auth-card {
  width: 100%;
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: 
    0 30px 60px -12px rgba(0, 0, 0, 0.75),
    0 0 1px 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  min-height: 480px;
}

/* Left Panel: Dreamy Gradient & Logo */
.card-left {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0d0e14;
  border-right: 1px solid var(--card-border);
  min-height: 300px;
}

.dreamy-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  transition: background 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease, transform 1.2s ease;
}

.orb-1 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, rgba(148, 163, 184, 0.03) 70%);
  top: -40px;
  left: -30px;
  animation: orbFloat1 10s ease-in-out infinite alternate;
}

.orb-2 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(203, 213, 225, 0.05) 0%, rgba(100, 116, 139, 0.02) 70%);
  bottom: -40px;
  right: -30px;
  animation: orbFloat2 12s ease-in-out infinite alternate;
}

.orb-3 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  top: 40%;
  left: 20%;
  opacity: 0.3;
  animation: orbFloat3 14s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.15); }
}

@keyframes orbFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-35px, -30px) scale(1.1); }
}

@keyframes orbFloat3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(25px, -35px) scale(1.2); }
}

.left-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
}

.logo-wrap {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: rgba(18, 19, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.brand-svg {
  display: block;
  filter: drop-shadow(0 4px 12px rgba(84, 176, 240, 0.3));
  transition: opacity 0.3s ease;
}

.brand-img-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.left-status-text {
  font-size: 19px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.left-status-text.fade-swap {
  opacity: 0;
  transform: translateY(4px);
}

/* Right Panel: Content & Forms */
.card-right {
  flex: 1.15;
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--card-bg);
}

/* Service Title above Switcher */
.service-brand-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  text-align: left;
  min-height: 28px;
  line-height: 1.3;
  opacity: 1 !important;
  display: block;
  transition: opacity 0.25s ease;
}

/* Switcher / Options */
.auth-switch-wrapper {
  margin-bottom: 18px;
}

.auth-switch {
  position: relative;
  display: flex;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.switch-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.auth-switch.signup-mode .switch-pill {
  transform: translateX(100%);
}

.switch-btn {
  flex: 1;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-secondary);
  cursor: pointer;
  border-radius: 9px;
  position: relative;
  z-index: 2;
  transition: color 0.2s ease;
  outline: none;
}

.switch-btn:hover {
  color: var(--accent);
}

.switch-btn.active {
  color: #ffffff;
}

/* Subtitle */
.auth-subtitle {
  font-size: 13.5px;
  color: var(--accent-secondary);
  margin-bottom: 24px;
  line-height: 1.45;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-subtitle.fade-swap {
  opacity: 0;
  transform: translateY(3px);
}

/* Error Notification */
.auth-error-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger-color);
  margin-bottom: 18px;
  animation: fadeIn 0.2s ease-out;
}

.auth-error-msg.hidden {
  display: none !important;
}

/* Form & Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-wrap {
  position: relative;
  width: 100%;
}

.auth-field {
  width: 100%;
  height: 44px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  color: var(--accent);
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.auth-field::placeholder {
  color: #52525b;
}

.auth-field:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.12);
  background: #1c1c20;
}

.password-wrap .auth-field {
  padding-right: 44px;
}

/* Password Toggle */
.toggle-password-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--accent-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.toggle-password-btn:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.toggle-password-btn svg {
  display: block;
}

/* Submit Button */
.auth-submit-btn {
  width: 100%;
  height: 44px;
  background: var(--accent);
  color: #09090b;
  border: none;
  border-radius: var(--radius-input);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.08);
}

.auth-submit-btn:hover {
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.14);
}

.auth-submit-btn:active {
  transform: scale(0.99);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(9, 9, 11, 0.3);
  border-radius: 50%;
  border-top-color: #09090b;
  animation: spin 0.7s linear infinite;
}

.spinner.hidden {
  display: none;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Privacy Policy Link */
.privacy-link-row {
  margin-top: 14px;
  text-align: center;
}

.privacy-policy-link {
  font-size: 11.5px;
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
  letter-spacing: 0.02em;
}

.privacy-policy-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Guest Access Option for Public Services */
.guest-option-row {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.guest-divider {
  font-size: 11px;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.btn-guest-continue {
  background: transparent;
  border: 1px dashed rgba(226, 232, 240, 0.25);
  border-radius: 10px;
  color: var(--accent);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
}

.btn-guest-continue:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  color: #ffffff;
}

/* Responsive */
@media (max-width: 720px) {
  .auth-card {
    flex-direction: column;
    min-height: auto;
  }
  .card-left {
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    padding: 36px 20px;
    min-height: 200px;
  }
  .card-right {
    padding: 32px 24px 36px;
  }
}
