/* ================================================================
   EmailFlow Pro — Premium SaaS Authentication Design System
   Inspired by Reference Video (Soft Lavender Background, 3D Character, Modern Card)
   Brand Colors:
     - Background: #F0EFFF
     - Main Purple: #7546F5
     - Accent Purple: #8B4DF6
     - Deep Purple: #6135D9
     - Primary Text: #24213D
     - Secondary Text: #686783
     - White: #FFFFFF
     - Border: #ECEAF5
   Typography: Space Grotesk (Headings) & Montserrat (Body, Inputs, Buttons)
   100% Solid Colors (No Gradients) | Soft Natural Shadows | Full Responsive
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  --bg-page: #F0EFFF;
  --bg-card: #FFFFFF;
  --bg-panel-left: #F7F6FF;
  --bg-input: #FFFFFF;
  --bg-input-hover: #FCFBFF;

  --color-primary: #7546F5;
  --color-accent: #8B4DF6;
  --color-deep: #6135D9;
  --color-text-main: #24213D;
  --color-text-muted: #686783;
  --color-text-light: #8E8DA3;
  --color-white: #FFFFFF;
  --color-border: #ECEAF5;
  --color-border-focus: #7546F5;

  --color-error-bg: #FEF2F2;
  --color-error-border: #FEE2E2;
  --color-error-text: #DC2626;

  --color-success-bg: #F0FDF4;
  --color-success-border: #DCFCE7;
  --color-success-text: #16A34A;

  --shadow-sm: 0 2px 6px rgba(36, 33, 61, 0.04);
  --shadow-card: 0 24px 64px -14px rgba(117, 70, 245, 0.12), 0 8px 24px -4px rgba(36, 33, 61, 0.04);
  --shadow-btn: 0 8px 20px -4px rgba(117, 70, 245, 0.32);
  --shadow-btn-active: 0 2px 8px -2px rgba(117, 70, 245, 0.28);

  --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;

  --radius-card: 28px;
  --radius-panel: 20px;
  --radius-input: 12px;
  --radius-btn: 12px;
  --radius-pill: 50px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--color-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* ── Atmosphere & Page Wrapper ───────────────────────────────── */
.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 48px;
  position: relative;
  background-color: var(--bg-page);
}

/* Subtle decorative atmospheric clouds / glow */
.auth-page-wrapper::before {
  content: '';
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 77, 246, 0.09) 0%, rgba(240, 239, 255, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Centered Authentication Card ────────────────────────────── */
.auth-centered-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Left Animated Visual Section ────────────────────────────── */
.auth-left-panel {
  position: relative;
  background: var(--bg-panel-left);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
}

.auth-mascot-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 480px;
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: #F4F2FF;
  border: 1px solid rgba(139, 77, 246, 0.12);
  display: block;
}

.auth-mascot-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.auth-mascot-static {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.d-none {
  display: none !important;
}

/* Left panel brand messaging at the bottom */
.auth-left-content {
  margin-top: 20px;
  padding: 8px 4px 4px;
  animation: contentFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes contentFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-left-headline {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.3;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.auth-left-support {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 0 16px;
  max-width: 440px;
}

.auth-left-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(117, 70, 245, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(117, 70, 245, 0.16);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.auth-pill-tag i {
  font-size: 12px;
}

.auth-pill-tag:hover {
  background: rgba(117, 70, 245, 0.14);
  transform: translateY(-1px);
}

/* ── Right Authentication Form Section ───────────────────────── */
.auth-right-panel {
  padding: 48px 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-card);
}

.auth-form-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Header & Logo */
.auth-header-block {
  margin-bottom: 28px;
}

.auth-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  text-decoration: none;
}

.auth-logo-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px -3px rgba(117, 70, 245, 0.4);
}

.auth-logo-text {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.3px;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.25;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Error Alert */
.auth-alert-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  color: var(--color-error-text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 20px;
  animation: alertDrop 0.25s ease-out;
}

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

.auth-alert-error i {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}

/* Form Groups & Inputs */
.auth-form-group {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 7px;
  letter-spacing: 0.1px;
}

.auth-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-lead-icon {
  position: absolute;
  left: 14px;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 16px;
}

.auth-input-field {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 42px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-main);
  background: var(--bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-input-field::placeholder {
  color: var(--color-text-light);
  font-weight: 400;
}

.auth-input-field:hover {
  border-color: #D8D4EC;
  background: var(--bg-input-hover);
}

.auth-input-field:focus {
  border-color: var(--color-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(117, 70, 245, 0.15);
}

/* Password Toggle Button */
.auth-pw-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  padding: 6px 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.auth-pw-toggle-btn:hover {
  color: var(--color-primary);
  background: rgba(117, 70, 245, 0.08);
}

/* Extra Options: Remember Me & Forgot Password */
.auth-row-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
  margin-bottom: 22px;
  font-size: 13px;
}

.auth-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--color-text-muted);
  font-weight: 500;
}

.auth-custom-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--color-primary);
  cursor: pointer;
  margin: 0;
  border-radius: 4px;
}

.auth-forgot-anchor {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.auth-forgot-anchor:hover {
  color: var(--color-deep);
  text-decoration: underline;
}

/* Primary Purple Submit Button */
.auth-primary-btn {
  width: 100%;
  height: 50px;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.auth-primary-btn:hover {
  background: var(--color-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -4px rgba(97, 53, 217, 0.4);
}

.auth-primary-btn:active {
  background: var(--color-deep);
  transform: translateY(0);
  box-shadow: var(--shadow-btn-active);
}

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

/* Spinner for Button */
.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Footer Section */
.auth-form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.auth-form-footer a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.auth-form-footer a:hover {
  color: var(--color-deep);
  text-decoration: underline;
}

.auth-legal-strip {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 11.5px;
  color: var(--color-text-light);
}

.auth-legal-strip span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Commercial Packages Jump Link */
.auth-pricing-jump {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-pricing-jump:hover {
  color: var(--color-deep);
  text-decoration: underline;
}

/* ── Commercial Packages Wrapper Below ───────────────────────── */
.auth-pricing-wrapper {
  width: 100%;
  max-width: 1180px;
  margin: 40px auto 20px;
  padding: 0 16px;
  box-sizing: border-box;
}

.auth-pricing-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-pricing-badge {
  display: inline-block;
  background: rgba(117, 70, 245, 0.1);
  color: var(--color-primary);
  font-size: 11.5px;
  padding: 5px 14px;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.auth-pricing-title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.auth-pricing-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ── Responsive Design ───────────────────────────────────────── */
@media (max-width: 992px) {
  .auth-centered-card {
    grid-template-columns: 1fr;
    max-width: 540px;
    border-radius: 24px;
  }

  .auth-left-panel {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 20px;
  }

  .auth-mascot-frame {
    max-height: 340px;
  }

  .auth-left-content {
    margin-top: 14px;
  }

  .auth-left-headline {
    font-size: 20px;
  }

  .auth-right-panel {
    padding: 36px 32px 36px;
  }
}

@media (max-width: 576px) {
  .auth-page-wrapper {
    padding: 16px 12px 32px;
  }

  .auth-centered-card {
    border-radius: 20px;
  }

  .auth-left-panel {
    padding: 16px;
  }

  .auth-mascot-frame {
    max-height: 260px;
  }

  .auth-left-headline {
    font-size: 18px;
  }

  .auth-left-support {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .auth-pill-tag {
    font-size: 11px;
    padding: 4px 10px;
  }

  .auth-right-panel {
    padding: 28px 20px 28px;
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-input-field {
    height: 46px;
    font-size: 13.5px;
  }

  .auth-primary-btn {
    height: 48px;
    font-size: 14px;
  }
}

/* ── Below-Login Commercial Packages Section ─────────────────────── */
.auth-pricing-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none !important;
  padding: 6px 14px;
  background: var(--bg-panel-left);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 180ms ease;
}

.auth-pricing-jump:hover {
  background: #E8E4FF;
  color: var(--color-deep) !important;
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.auth-pricing-wrapper {
  width: 100%;
  max-width: 1280px;
  margin: 56px auto 72px;
  padding: 0 20px;
  box-sizing: border-box;
}

.auth-pricing-header {
  text-align: center;
  margin-bottom: 36px;
}

.auth-pricing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: #FFFFFF;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.auth-pricing-title {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0 0 12px;
  line-height: 1.25;
}

.auth-pricing-desc {
  font-size: 14.5px;
  color: var(--color-text-muted);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Pricing component integration enhancements */
.auth-pricing-wrapper .card {
  border-color: var(--color-border);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.auth-pricing-wrapper .card:hover {
  transform: translateY(-2px);
}

.auth-pricing-wrapper .table {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .auth-mascot-canvas {
    display: none !important;
  }

  .auth-mascot-static {
    display: block !important;
  }
}

