/* ==========================================================================
   Premium Enterprise SSO Stylesheet
   ========================================================================== */

/* Design Tokens & Theme Setup */
:root {
  /* Common variables */
  --font-primary: 'Plus Jakarta Sans', sans-serif;
  --font-secondary: 'Poppins', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --success-color: #10B981;
  --error-color: #EF4444;

  /* Brand palette — green-500 → cyan-500 */
  --gradi-green-500: #22c55e;
  --gradi-cyan-500: #06b6d4;

  /* Theme-specific variables (Dark Mode Default) */
  --bg-primary: #071210;
  --bg-secondary: rgba(7, 22, 18, 0.65);
  --bg-card: rgba(7, 22, 18, 0.5);
  --border-color: rgba(6, 182, 212, 0.12);
  --border-hover: rgba(34, 197, 94, 0.4);
  --text-primary: #F0FDF4;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --accent-gradient: linear-gradient(125deg, #22c55e, #06b6d4 65%);
  --accent-gradient-hover: linear-gradient(125deg, #06b6d4, #22c55e 65%);
  --accent-color: #06b6d4;
  --accent-secondary: #22c55e;
  --accent-glow: rgba(6, 182, 212, 0.28);
  --accent-glow-green: rgba(34, 197, 94, 0.22);
  --input-bg: rgba(4, 20, 16, 0.62);
  --input-focus-border: rgba(6, 182, 212, 0.55);
  --card-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), 0 0 50px -10px rgba(6, 182, 212, 0.07);
  --glass-blur: blur(20px);
  --illustration-ring-color: rgba(6, 182, 212, 0.18);
  --ui-card-bg: rgba(7, 22, 18, 0.78);
}

[data-theme="light"] {
  --bg-primary: #F0FDF4;
  --bg-secondary: rgba(255, 255, 255, 0.78);
  --bg-card: rgba(255, 255, 255, 0.75);
  --border-color: rgba(34, 197, 94, 0.12);
  --border-hover: rgba(6, 182, 212, 0.45);
  --text-primary: #052e16;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --accent-gradient: linear-gradient(125deg, #22c55e, #06b6d4 65%);
  --accent-gradient-hover: linear-gradient(125deg, #06b6d4, #22c55e 65%);
  --accent-color: #059669;
  --accent-secondary: #0891b2;
  --accent-glow: rgba(34, 197, 94, 0.22);
  --accent-glow-green: rgba(6, 182, 212, 0.18);
  --input-bg: rgba(255, 255, 255, 0.92);
  --input-focus-border: rgba(34, 197, 94, 0.55);
  --card-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.1), 0 10px 30px -5px rgba(34, 197, 94, 0.06);
  --illustration-ring-color: rgba(34, 197, 94, 0.14);
  --ui-card-bg: rgba(255, 255, 255, 0.88);
}

/* Reset & Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 15% 25%, rgba(34, 197, 94, 0.08), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.09), transparent 40%);
  color: var(--text-primary);
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Interactive Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Layout Container */
.app-container {
  width: 100%;
  max-width: 1440px;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    justify-content: space-between;
  }
}

/* Left Hero Section */
.hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .hero-section {
    display: none; /* Hide illustrative hero on mobile/tablet to focus on forms */
  }
}

.hero-glass-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 10% 20%, rgba(255, 107, 53, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.hero-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
}

/* Logo Design */
.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.logo-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 20px var(--accent-glow);
}

.logo-icon {
  color: #FFF;
  width: 24px;
  height: 24px;
}

.logo-text {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-text .highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Animated Illustration (Portal Engine) */
.illustration-container {
  position: relative;
  width: 100%;
  height: clamp(180px, 32vh, 340px);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto 0;
}

.sphere-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(10px);
  z-index: 0;
}

.shield-circle {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.rotating-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed var(--illustration-ring-color);
}

.ring-outer {
  width: 260px;
  height: 260px;
  animation: rotateClockwise 30s linear infinite;
  border-style: dotted;
}

.ring-middle {
  width: 200px;
  height: 200px;
  animation: rotateCounterClockwise 20s linear infinite;
  border-style: solid;
  border-color: rgba(6, 182, 212, 0.06);
  border-top-color: var(--accent-color);
  border-bottom-color: var(--accent-secondary);
}

.ring-inner {
  width: 140px;
  height: 140px;
  animation: rotateClockwise 10s linear infinite;
}

.shield-core {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), inset 0 2px 5px rgba(255, 255, 255, 0.05);
  z-index: 2;
  transition: transform 0.3s ease;
}

.shield-core:hover {
  transform: scale(1.08);
}

.core-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-color);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* Floating UI Cards */
.floating-ui-card {
  position: absolute;
  background: var(--ui-card-bg);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  z-index: 3;
  pointer-events: none;
}

.ui-card-1 {
  top: 15%;
  left: 10%;
  animation: floatCard1 6s ease-in-out infinite;
}

.ui-card-2 {
  bottom: 15%;
  right: 10%;
  animation: floatCard2 7s ease-in-out infinite;
}

.ui-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ui-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.ui-icon.cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-color);
}

.ui-text {
  display: flex;
  flex-direction: column;
}

.ui-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ui-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Hero Typography */
.hero-messaging {
  max-width: 500px;
}

.hero-title {
  font-family: var(--font-secondary);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Hero Footer */
.hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.badge-lock-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-color);
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Form Section (Right Side) */
.form-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  position: relative;
}

@media (max-width: 640px) {
  .form-section {
    padding: 20px;
  }
}

.auth-card-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  perspective: 1000px;
}

.auth-card-glow {
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
  border-radius: calc(var(--radius-lg) + 15px);
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--accent-glow) 0%, transparent 60%);
  filter: blur(20px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

.auth-card-wrapper:hover .auth-card-glow {
  opacity: 1;
}

/* Main Card */
.auth-card {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 0; /* Padding moved to inner step-panels to prevent slide-overflow leak */
  box-shadow: var(--card-shadow);
  transform-style: preserve-3d;
  transition: border-color 0.4s ease, transform 0.1s ease-out;
  overflow: visible;
  z-index: 1;
}

.step-panel,
.forgot-panel,
#screen-signup {
  padding: 48px;
  width: 100%;
}

@media (max-width: 640px) {
  .auth-card {
    border-radius: var(--radius-md);
  }
  .step-panel,
  .forgot-panel,
  #screen-signup {
    padding: 32px 24px;
  }
}

.card-inner-slider {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-screen {
  width: 100%;
  flex-shrink: 0;
}

/* Header Styles */
.form-header {
  margin-bottom: 32px;
}

.form-title {
  font-family: var(--font-secondary);
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.form-description {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Input Fields & Labels */
.input-group {
  margin-bottom: 24px;
  position: relative;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: var(--transition-fast);
  pointer-events: none;
  z-index: 2;
}

.input-wrapper input {
  width: 100%;
  height: 56px;
  padding: 20px 20px 6px 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-fast);
  z-index: 1;
}

/* Floating labels */
.input-wrapper label {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-fast);
  z-index: 2;
}

.input-wrapper input:focus ~ label,
.input-wrapper input:not(:placeholder-shown) ~ label {
  top: 14px;
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 600;
}

.input-glow-border {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  pointer-events: none;
  transition: var(--transition-smooth);
  z-index: 0;
}

.input-wrapper input:focus ~ .input-glow-border {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 12px var(--accent-glow);
}

.input-wrapper input:focus {
  border-color: transparent;
  background-color: var(--bg-primary);
}

.input-wrapper input:focus ~ .field-icon {
  color: var(--accent-color);
}

/* Error States */
.field-error {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--error-color);
  margin-top: 6px;
  min-height: 16px;
}

.input-wrapper.has-error input, .input-validation-error {
  border-color: var(--error-color) !important;
}

.input-wrapper.has-error input:focus ~ .input-glow-border {
  border-color: var(--error-color);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.input-wrapper.has-error .field-icon {
  color: var(--error-color);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.password-toggle:hover {
  color: var(--text-primary);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* Forms Options (Remember Me / Forgot Link) */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  border-radius: var(--radius-sm);
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--border-hover);
}

.checkbox-container input:checked ~ .checkmark {
  background: var(--accent-gradient);
  border-color: transparent;
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.checkbox-container .checkmark::after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Link Button */
.link-btn {
  background: none;
  border: none;
  font-family: var(--font-primary);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-color);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
  text-decoration: none;
}

.link-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.form-prompt {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #FFF;
  border: none;
  box-shadow: 0 10px 25px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-primary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(1px);
}

/* Button Shine Animation */
.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  pointer-events: none;
}

.btn:hover .btn-shine {
  animation: shine 0.75s ease-out;
}

.btn-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

.w-100 {
  width: 100%;
}

/* Dividers */
.divider {
  display: flex;
  align-items: center;
  margin: 28px 0;
  text-align: center;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider span {
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* OAuth Grid */
.oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.oauth-btn {
  height: 48px;
}

.oauth-logo {
  margin-right: 4px;
}

/* Back Nav Panel */
.step-back-nav {
  margin-bottom: 24px;
}

#screen-forgot .step-back-nav {
  padding: 48px 48px 0 48px;
  margin-bottom: 0px;
}

#screen-forgot .forgot-panel {
  padding-top: 24px;
}

@media (max-width: 640px) {
  #screen-forgot .step-back-nav {
    padding: 32px 24px 0 24px;
  }
  #screen-forgot .forgot-panel {
    padding-top: 16px;
  }
}

.back-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 4px 0;
}

.back-btn:hover {
  color: var(--accent-color);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

/* Identity to Password Steps Slider (3D Flip) */
.step-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  perspective: 1000px;
}

.step-panel {
  grid-area: 1 / 1 / 2 / 2;
  width: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  position: absolute;
  top: 0;
  left: 0;
}

/* Active panel layout configurations to define dynamic container height */
.step-container:not(.flip-to-password):not(.show-forgot-step) #step-identity {
  position: relative;
}

.step-container.flip-to-password #step-password {
  position: relative;
}

.step-container.show-forgot-step #step-forgot {
  position: relative;
}

#step-identity {
  transform: rotateY(0deg);
  transition: opacity 150ms ease-in-out, visibility 150ms ease-in-out;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#step-password {
  transform: rotateY(180deg);
  transition: opacity 150ms ease-in-out, visibility 150ms ease-in-out;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* When flipped to password (Step 2) */
.step-container.flip-to-password {
  transform: rotateY(180deg);
}

.step-container.flip-to-password #step-identity {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0ms;
}

.step-container.flip-to-password #step-password {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 200ms;
}

/* When flipped back to identity (Step 1) */
.step-container:not(.flip-to-password) #step-password {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0ms;
}

.step-container:not(.flip-to-password) #step-identity {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 200ms;
}

/* User avatar widget on Password screen */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding: 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
}

.user-avatar-container {
  position: relative;
  width: 52px;
  height: 52px;
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #FFF;
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.avatar-verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background-color: var(--bg-primary);
  color: var(--accent-color);
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.user-avatar-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 1.5s infinite;
  display: none;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.welcome-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.welcome-email {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Password Strength Indicator */
.password-strength-meter {
  margin-top: 8px;
}

.strength-bar-container {
  width: 100%;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-bar {
  height: 100%;
  width: 0;
  transition: width 0.4s ease, background-color 0.4s ease;
  border-radius: 2px;
}

.strength-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.strength-text {
  font-weight: 600;
  color: var(--text-muted);
}

.strength-criteria {
  color: var(--text-muted);
}

/* Forgot Password Slide Panel */
.forgot-content-slider {
  display: flex;
  width: 200%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.forgot-panel {
  width: 50%;
  flex-shrink: 0;
}

.forgot-content-slider.slide-to-success {
  transform: translate3d(-50%, 0, 0);
}

/* Success Checkmark drawing animation */
.success-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px auto;
}

.success-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.1);
  animation: pulseSuccessRing 2s infinite;
}

.success-checkmark-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.checkmark-svg {
  width: 40px;
  height: 40px;
  stroke: var(--success-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checkmark-circle-path {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--success-color);
  fill: none;
  animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check-path {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

.success-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 32px;
}

.success-box-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.success-box span {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.text-center {
  text-align: center;
}

/* Theme Toggle Button Style */
.theme-toggle-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  backdrop-filter: var(--glass-blur);
  z-index: 100;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  border-color: var(--border-hover);
  color: var(--accent-color);
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: none;
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* Diagonal Swipe Overlay Element */
.swipe-overlay {
  position: fixed;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: var(--accent-gradient);
  z-index: 999;
  pointer-events: none;
  display: none;
}

.swipe-skew {
  width: 100%;
  height: 100%;
  transform: skewX(-15deg);
  background: inherit;
}

.swipe-overlay.animate-swipe {
  display: block;
  animation: swipeDiagonal 0.7s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

/* Toast Notifications styling */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-container {
    left: 24px;
    right: 24px;
    bottom: 16px;
  }
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  padding: 16px;
  min-width: 320px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  transform: translate3d(0, 50px, 0);
  opacity: 0;
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .toast {
    min-width: 100%;
  }
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: var(--success-color);
}

.toast-error .toast-icon {
  color: var(--error-color);
}

.toast-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
  transition: var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background-color: var(--accent-color);
  transform-origin: left;
  animation: toastProgress 4s linear forwards;
}

.toast-success .toast-progress {
  background-color: var(--success-color);
}

.toast-error .toast-progress {
  background-color: var(--error-color);
}

/* Skeleton Loading Effect */
.skeleton-pulse {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.12) 37%,
    rgba(255, 255, 255, 0.05) 63%
  );
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
}

[data-theme="light"] .skeleton-pulse {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 25%,
    rgba(0, 0, 0, 0.08) 37%,
    rgba(0, 0, 0, 0.04) 63%
  );
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
}

/* Button Loading spinner representation */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.btn-secondary .btn-spinner {
  border-color: rgba(6, 182, 212, 0.3);
  border-top-color: var(--accent-color);
}

/* Keyframes Definitions */
@keyframes rotateClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateCounterClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes floatCard1 {
  0% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
  100% { transform: translateY(0) rotate(-1deg); }
}

@keyframes floatCard2 {
  0% { transform: translateY(0) rotate(1deg); }
  50% { transform: translateY(-15px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(1deg); }
}

@keyframes shine {
  100% { left: 125%; }
}

@keyframes swipeDiagonal {
  0% { left: -150%; }
  50% { left: -25%; }
  100% { left: 100%; }
}

@keyframes strokeCircle {
  100% { stroke-dashoffset: 0; }
}

@keyframes strokeCheck {
  100% { stroke-dashoffset: 0; }
}

@keyframes pulseSuccessRing {
  0% { transform: scale(0.95); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0; }
}

@keyframes toastIn {
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes toastProgress {
  to { transform: scaleX(0); }
}

@keyframes skeletonLoading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

/* Motion Blur Effect helper during card slider animations */
.motion-blur-slide {
  filter: blur(1.5px);
  transform: scale(0.97);
  opacity: 0.6;
  transition: filter 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.text-danger { font-size: 0.8rem; font-weight: 500; color: var(--error-color); margin-top: 6px; display: block; }
.auth-validation-summary { font-size: 0.85rem; color: var(--error-color); margin-bottom: 24px; padding: 12px; background: rgba(239, 68, 68, 0.1); border-radius: var(--radius-sm); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Mobile Header & Footer Layout */
.mobile-header {
  display: none;
  padding: 32px 24px 0;
  z-index: 2;
}

.mobile-footer {
  display: none;
  padding: 24px;
  border-top: 1px solid var(--border-color);
  justify-content: center;
  align-items: center;
  z-index: 2;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mobile-footer a {
  text-decoration: none;
}

@media (max-width: 1024px) {
  .mobile-header {
    display: flex;
    justify-content: center;
    padding: 20px 24px 10px;
  }
  .mobile-footer {
    display: flex;
    padding: 16px;
  }
  .form-section {
    flex: 1 1 auto;
    padding: 24px;
    overflow: hidden;
  }
}

/* Dynamic Premium Username Styling & Entrance Animations */
.hero-username-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(15px) scale(0.96);
  will-change: transform, opacity;
}

.hero-username {
  font-family: var(--font-secondary);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.hero-verified-icon {
  color: var(--success-color);
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.45));
}

.animate-premium-username {
  animation: premiumUsernameEntrance 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes premiumUsernameEntrance {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Compact Layouts for Shorter Viewports */
@media (max-height: 720px) {
  .hero-section {
    padding: 32px;
  }
  .hero-title {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  .hero-username {
    font-size: 1.8rem;
  }
  .form-section {
    padding: 20px;
  }
  .step-panel,
  .forgot-panel,
  #screen-signup {
    padding: 32px 24px;
  }
  .form-header {
    margin-bottom: 20px;
  }
  .input-group {
    margin-bottom: 16px;
  }
  .form-options {
    margin-bottom: 16px;
  }
  .form-prompt {
    margin-top: 16px;
  }
  .user-profile-widget {
    margin-bottom: 20px;
    padding: 12px;
  }
}

@media (max-height: 600px) {
  .step-panel,
  .forgot-panel,
  #screen-signup {
    padding: 20px 20px;
  }
  .form-header {
    margin-bottom: 12px;
  }
  .form-title {
    font-size: 1.5rem;
  }
  .input-group {
    margin-bottom: 12px;
  }
  .input-wrapper input {
    height: 48px;
    padding: 16px 16px 4px 44px;
  }
  .input-wrapper label {
    left: 44px;
  }
  .input-wrapper input:focus ~ label,
  .input-wrapper input:not(:placeholder-shown) ~ label {
    top: 10px;
    font-size: 0.7rem;
  }
  .user-profile-widget {
    margin-bottom: 12px;
    padding: 8px;
    gap: 12px;
  }
  .user-avatar-container {
    width: 40px;
    height: 40px;
  }
  .user-avatar {
    font-size: 1rem;
  }
  .welcome-email {
    font-size: 0.95rem;
  }
  .form-options {
    margin-bottom: 12px;
  }
  .btn {
    height: 44px;
  }
}

/* Typewriter Cursor styling */
.typewriter-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent-color);
  font-weight: 300;
  animation: typewriterBlink 0.8s infinite;
}

@keyframes typewriterBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Custom logo scaling and animations */
.logo-img-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  flex-shrink: 0;
  box-shadow: 0 8px 20px var(--accent-glow);
  transition: transform 0.3s ease;
}

.logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: logoFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logoFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Forgot Password Step Layout Transitions */
#step-forgot {
  transform: rotateY(0deg);
  transition: opacity 150ms ease-in-out, visibility 150ms ease-in-out;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.step-container.show-forgot-step {
  transform: rotateY(0deg);
}

.step-container.show-forgot-step #step-forgot {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 200ms;
}

.step-container.show-forgot-step #step-identity {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0ms;
}

.step-container.show-forgot-step #step-password {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0ms;
}
