/* =============================================
   SSO Platform - Design System
   Aesthetic: Corporate Precision / Dark Luxury
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── Tokens: Light (forced) ──────────────────── */
:root {
  --bg-base:       #F4F6FB;
  --bg-surface:    #FFFFFF;
  --bg-elevated:   #F0F3FA;
  --bg-card:       #E8EDF7;

  --border-subtle: rgba(0,0,0,0.06);
  --border-mid:    rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.18);

  --accent:        #2563EB;
  --accent-glow:   rgba(37,99,235,0.20);
  --accent-bright: #1D4ED8;
  --accent-muted:  rgba(37,99,235,0.08);

  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;

  --text-primary:  #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;

  --font-display:  'Roboto', sans-serif;
  --font-body:     'DM Sans', sans-serif;

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-card:   0 4px 24px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-glow:   0 0 40px rgba(37,99,235,0.08);

  --navbar-bg:     rgba(244,246,251,0.8);
  --navbar-scroll: rgba(244,246,251,0.95);
  --noise-opacity: 0.15;
}

/* ── Theme toggle hidden (light mode forced) ─── */
.theme-toggle-wrap { display:none !important; }

/* ── System preference fallback (no JS) ─────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-base:       #F4F6FB;
    --bg-surface:    #FFFFFF;
    --bg-elevated:   #F0F3FA;
    --bg-card:       #E8EDF7;
    --border-subtle: rgba(0,0,0,0.06);
    --border-mid:    rgba(0,0,0,0.10);
    --border-strong: rgba(0,0,0,0.18);
    --accent:        #2563EB;
    --accent-glow:   rgba(37,99,235,0.20);
    --accent-bright: #1D4ED8;
    --accent-muted:  rgba(37,99,235,0.08);
    --text-primary:  #0F172A;
    --text-secondary:#475569;
    --text-muted:    #94A3B8;
    --shadow-card:   0 4px 24px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-glow:   0 0 40px rgba(37,99,235,0.08);
    --navbar-bg:     rgba(244,246,251,0.8);
    --navbar-scroll: rgba(244,246,251,0.95);
    --noise-opacity: 0.15;
  }
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: transparent;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

html {
  background-color: var(--bg-base);
}

a {
  text-decoration: none;
  color: inherit;
}

img { display: block; max-width: 100%; }

/* ── Noise texture overlay ───────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: var(--noise-opacity);
  transition: opacity 0.3s;
}

#ripple-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
  opacity: 0.7;
}

[data-theme="light"] #ripple-canvas {
  opacity: 0.55;
}

/* ── Fluid canvas ───────────────────────────── */
#fluid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
  opacity: 1;
}

#fluid-canvas.interactive {
  pointer-events: auto;
}

/* ── Smoke background animation ─────────────── */
/* ── Mesh gradient background ────────────────── */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(59,130,246,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99,102,241,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(14,165,233,0.04) 0%, transparent 70%);
}

/* ── Layout wrapper ──────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   HEADER / NAVBAR
   ============================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0;
  transition: all 0.3s ease;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 32px;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s, border-color 0.3s;
}

.navbar.scrolled .navbar-inner {
  background: var(--navbar-scroll);
  border-bottom-color: var(--border-mid);
}

/* Logo */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0;
  color: var(--text-primary);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand-text span {
  color: var(--accent-bright);
}

/* Nav links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.navbar-nav a:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

/* CTA buttons */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}

.btn:hover::after {
  background: rgba(255,255,255,0.04);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-mid);
  background: var(--border-subtle);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: var(--accent-muted);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
  background: #2563EB;
  box-shadow: 0 0 28px rgba(59,130,246,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-lg {
  font-size: 1rem;
  padding: 13px 28px;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  position: relative;
  z-index: 1;
  padding: 160px 0 100px;
  text-align: center;
  background: transparent;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-muted);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 100px;
  padding: 6px 14px 6px 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-bright);
  margin-bottom: 28px;
  animation: fadeSlideDown 0.6s ease both;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.8); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--text-primary);
  margin-bottom: 24px;
  animation: fadeSlideDown 0.7s 0.1s ease both;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--accent-bright) 0%, #818CF8 50%, #38BDF8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  font-weight: 300;
  line-height: 1.7;
  animation: fadeSlideDown 0.7s 0.2s ease both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  animation: fadeSlideDown 0.7s 0.3s ease both;
}

.hero-divider {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Stats bar ───────────────────────────────── */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border-subtle);
  animation: fadeSlideDown 0.7s 0.5s ease both;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* =============================================
   FEATURES GRID
   ============================================= */
.section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 56px;
}

.feature-card {
  background: var(--bg-surface);
  padding: 36px 32px;
  transition: background 0.2s;
  position: relative;
}

.feature-card:hover {
  background: var(--bg-elevated);
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-muted), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-muted);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding: 20px 24px;
  background: var(--bg-surface);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.footer-brand-name {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.01em;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.footer-links a:hover {
  color: var(--accent-bright);
}

/* =============================================
   AUTH PAGES (Login / Register)
   ============================================= */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 40px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card), 0 0 60px rgba(59,130,246,0.05);
  animation: fadeSlideDown 0.5s ease both;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Form elements */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input-wrap {
  position: relative;
}

.form-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.form-control.has-icon {
  padding-left: 38px;
}

.form-helper {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--accent-bright);
  font-weight: 500;
  transition: color 0.2s;
}

.form-footer a:hover {
  color: #fff;
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.83rem;
}

.remember-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.remember-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.forgot-link {
  color: var(--accent-bright);
  font-size: 0.83rem;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: #fff;
}

.btn-full { width: 100%; }

/* Alert / error */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #FCA5A5;
}

.alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: #6EE7B7;
}

/* Password toggle */
.input-action {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 15px;
  transition: color 0.2s;
}

.input-action:hover {
  color: var(--text-secondary);
}

/* SSO providers */
.sso-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.btn-provider {
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  width: 100%;
}

.btn-provider:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.provider-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* =============================================
   THEME TOGGLE
   ============================================= */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-mid);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-card);
}

.theme-toggle svg {
  transition: transform 0.4s ease, opacity 0.2s;
}

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sys  { display: none; }

[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sys  { display: none; }

[data-theme="system"] .theme-toggle .icon-sun  { display: none; }
[data-theme="system"] .theme-toggle .icon-moon { display: none; }
[data-theme="system"] .theme-toggle .icon-sys  { display: block; }

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 140px;
  box-shadow: var(--shadow-card);
  z-index: 200;
  display: none;
  animation: fadeSlideDown 0.15s ease both;
}

.theme-menu.open { display: block; }

.theme-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.theme-menu-item:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.theme-menu-item.active {
  color: var(--accent);
  background: var(--accent-muted);
}

.theme-toggle-wrap {
  position: relative;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =============================================
   UTILITIES
   ============================================= */
.text-accent   { color: var(--accent-bright); }
.text-muted    { color: var(--text-muted); }
.text-center   { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-inner { padding: 0 20px; }

  .hero { padding: 120px 0 60px; }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 28px;
  }

  .stat-value { font-size: 1.4rem; }

  .auth-card { padding: 28px 24px; }
}
