/* MyInvy Identity - Design System */
/* Matching Marketing App Aesthetic */

/* =====================================================
   Google Fonts Import
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* =====================================================
   CSS Variables (Design Tokens)
   ===================================================== */
:root {
  /* Colors - Primary (Trust Blue) */
  --color-primary: #2563EB;
  --color-primary-light: #3B82F6;
  --color-primary-dark: #1D4ED8;
  --color-primary-gradient: linear-gradient(135deg, #2563EB, #3B82F6);

  /* Colors - Accent (Orange) */
  --color-accent: #F97316;
  --color-accent-light: #FB923C;

  /* Colors - Text */
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #64748B;
  --color-text-inverse: #ffffff;

  /* Colors - Backgrounds */
  --color-bg-page: #F8FAFC;
  --color-bg-surface: #ffffff;
  --color-bg-surface-alt: #F1F5F9;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(16px);

  /* Colors - Border */
  --color-border: #CBD5E1;
  --color-border-light: #E2E8F0;

  /* Colors - States */
  --color-success: #16A34A;
  --color-error: #DC2626;
  --color-warning: #D97706;

  /* Focus */
  --color-focus-ring: rgba(37, 99, 235, 0.25);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 32px 64px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.15);

  /* Typography */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   Reset & Base
   ===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg-page);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Aurora Background */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-page::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse 80% 60% at 50% 20%,
      rgba(37, 99, 235, 0.12) 0%,
      rgba(59, 130, 246, 0.06) 30%,
      transparent 70%);
  z-index: -1;
  animation: aurora 12s ease-in-out infinite;
}

.auth-page::after {
  content: '';
  position: fixed;
  top: 0%;
  right: -30%;
  width: 100%;
  height: 150%;
  background: radial-gradient(ellipse 60% 80% at 80% 50%,
      rgba(199, 210, 254, 0.25) 0%,
      rgba(224, 231, 255, 0.12) 40%,
      transparent 70%);
  z-index: -1;
  animation: auroraSecondary 15s ease-in-out infinite;
}

@keyframes aurora {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.8;
  }

  50% {
    transform: translate(5%, 3%) scale(1.05);
    opacity: 1;
  }
}

@keyframes auroraSecondary {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }

  50% {
    transform: translate(-3%, 5%) scale(1.03);
    opacity: 0.9;
  }
}

/* =====================================================
   Typography
   ===================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

/* =====================================================
   Auth Container & Card
   ===================================================== */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  text-decoration: none;
}

.auth-logo svg {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
}

.auth-logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--color-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-title {
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

/* =====================================================
   Form Styles
   ===================================================== */
.form-group {
  margin-bottom: 0.875rem;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-focus-ring);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.form-check-input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-check-label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.form-error {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-error);
  margin-top: 0.375rem;
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-focus-ring);
}

.btn-primary {
  width: 100%;
  color: var(--color-text-inverse);
  background: var(--color-primary-gradient);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-secondary {
  width: 100%;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-surface-alt);
  border-color: var(--color-border);
}

.btn-outline {
  color: var(--color-primary);
  background: transparent;
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* External Login Buttons */
.external-logins {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

.external-logins-title {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.external-logins-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-external {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-external:hover {
  background: var(--color-bg-surface-alt);
  border-color: var(--color-border);
}

.btn-external svg {
  flex-shrink: 0;
}

/* Google Button - White with subtle border */
.btn-google {
  background: #ffffff;
  border: 1px solid #dadce0;
  color: #3c4043;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #dadce0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Apple Button - Solid black */
.btn-apple {
  background: #000000;
  border: 1px solid #000000;
  color: #ffffff;
}

.btn-apple:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

/* Logo in Card (top of card) */
.auth-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.auth-card-logo svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
}

.auth-card-logo-text {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  background: var(--color-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================================================
   Links
   ===================================================== */
.auth-links {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.auth-links a {
  font-weight: 500;
}

/* =====================================================
   Alerts
   ===================================================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.alert-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--color-error);
}

.alert-success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: var(--color-success);
}

/* =====================================================
   Header & Footer
   ===================================================== */
.auth-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: center;
}

.auth-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-text-muted);
}

.auth-footer a:hover {
  color: var(--color-primary);
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
  }

  h1 {
    font-size: 1.75rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

  .auth-page::before,
  .auth-page::after {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }
}