/* ============================================
   Mr.Certi Global CSS Design System
   ============================================ */

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

/* CSS Variables */
:root {
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-300: #7dd3fc;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --sky-600: #0284c7;
  --sky-700: #0369a1;
  --sky-800: #075985;
  --sky-900: #0c4a6e;

  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --purple: #8b5cf6;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(14,165,233,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(14,165,233,0.15), 0 2px 8px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(14,165,233,0.20), 0 4px 16px rgba(0,0,0,0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--sky-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sky-50); }
::-webkit-scrollbar-thumb { background: var(--sky-300); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--sky-400); }

/* ---- Animated Background ---- */
.bg-animated {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35;
  animation: orbFloat 8s ease-in-out infinite;
}
.bg-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--sky-300), transparent);
  top: -200px; left: -150px; animation-delay: 0s;
}
.bg-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--sky-400), transparent);
  bottom: -100px; right: -100px; animation-delay: -3s;
}
.bg-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #7dd3fc, transparent);
  top: 40%; left: 50%; animation-delay: -6s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ---- Navbar ---- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(14,165,233,0.12);
  transition: var(--transition);
}
.navbar.scrolled {
  padding: 12px 40px;
  box-shadow: var(--shadow-md);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.brand-icon { display: flex; align-items: center; }
.brand-name {
  font-size: 1.3rem; font-weight: 800; color: var(--gray-900); letter-spacing: -0.5px;
}
.brand-name span { color: var(--sky-500); }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-full);
  font-size: 0.9rem; font-weight: 500; color: var(--gray-600);
  text-decoration: none; transition: var(--transition);
}
.nav-link:hover { background: var(--sky-100); color: var(--sky-600); }

.btn-nav {
  padding: 9px 22px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  color: white; font-weight: 600; font-size: 0.9rem;
  border: none; cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 10px rgba(14,165,233,0.3);
}
.btn-nav:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(14,165,233,0.4); }
.btn-nav:active { transform: translateY(0); }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px; background: var(--gray-700);
  border-radius: 2px; transition: var(--transition);
}

/* ---- Buttons ---- */
.btn-primary {
  padding: 14px 32px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  color: white; font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 20px rgba(14,165,233,0.35);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(14,165,233,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-large { padding: 16px 40px; font-size: 1.05rem; }

.btn-ghost {
  padding: 14px 24px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.8); backdrop-filter: blur(10px);
  color: var(--gray-700); font-weight: 600; font-size: 1rem;
  border: 1.5px solid var(--gray-200); cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { background: white; border-color: var(--sky-300); color: var(--sky-600); transform: translateY(-1px); }

.btn-secondary {
  padding: 10px 20px; border-radius: var(--radius-md);
  background: var(--sky-100); color: var(--sky-700);
  font-weight: 600; font-size: 0.875rem;
  border: 1.5px solid var(--sky-200); cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover { background: var(--sky-200); }

.btn-outline {
  padding: 10px 20px; border-radius: var(--radius-md);
  background: transparent; color: var(--gray-600);
  font-weight: 500; font-size: 0.875rem;
  border: 1.5px solid var(--gray-200); cursor: pointer; transition: var(--transition);
}
.btn-outline:hover { border-color: var(--sky-300); color: var(--sky-600); }

.btn-danger {
  padding: 10px 20px; border-radius: var(--radius-md);
  background: #fee2e2; color: var(--error);
  font-weight: 600; font-size: 0.875rem;
  border: 1.5px solid #fecaca; cursor: pointer; transition: var(--transition);
}
.btn-danger:hover { background: #fecaca; }

/* ---- Sections ---- */
.section-header { text-align: center; margin-bottom: 60px; }
.section-badge {
  display: inline-block; padding: 6px 16px; border-radius: var(--radius-full);
  background: var(--sky-100); color: var(--sky-700);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-size: 2.2rem; font-weight: 800; color: var(--gray-900);
  letter-spacing: -0.5px; line-height: 1.2; margin-bottom: 16px;
}
.section-subtitle { font-size: 1.05rem; color: var(--gray-500); max-width: 520px; margin: 0 auto; }

.gradient-text {
  background: linear-gradient(135deg, var(--sky-500), var(--sky-700));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Hero ---- */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh; padding: 120px 40px 80px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 60px; max-width: 1280px; margin: 0 auto;
}
.hero-content { flex: 1; max-width: 560px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, #fef9c3, #fef08a);
  color: #92400e; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 24px; border: 1px solid #fde68a;
}
.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.5rem); font-weight: 900;
  color: var(--gray-900); line-height: 1.1; letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: 1.1rem; color: var(--gray-500); margin-bottom: 36px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats {
  display: flex; align-items: center; gap: 24px;
  padding: 20px 24px; background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px); border-radius: var(--radius-lg);
  border: 1px solid var(--sky-100); width: fit-content;
}
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--sky-600); }
.stat-label { display: block; font-size: 0.75rem; color: var(--gray-500); font-weight: 500; }
.stat-divider { width: 1px; height: 36px; background: var(--gray-200); }

.hero-visual { flex: 1; display: flex; justify-content: center; position: relative; }
.cert-card-preview {
  background: white; border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); width: 360px;
  border: 1px solid var(--gray-100); overflow: hidden;
  animation: cardFloat 5s ease-in-out infinite;
}
@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.cert-preview-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.cert-dots { display: flex; gap: 6px; }
.cert-dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.cert-dots span:nth-child(1) { background: #ff5f57; }
.cert-dots span:nth-child(2) { background: #ffbd2e; }
.cert-dots span:nth-child(3) { background: #28ca41; }
.cert-preview-title { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; }

.cert-preview-body { padding: 20px; }
.cert-mock {
  background: linear-gradient(135deg, var(--sky-50), white);
  border: 2px solid var(--sky-200); border-radius: var(--radius-lg);
  padding: 24px; text-align: center;
}
.cert-mock-badge { font-size: 2rem; margin-bottom: 8px; }
.cert-mock-subtitle { font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--sky-500); font-weight: 600; margin-bottom: 12px; }
.cert-mock-name { font-size: 1.25rem; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; }
.cert-mock-text { font-size: 0.78rem; color: var(--gray-500); margin-bottom: 6px; }
.cert-mock-course { font-size: 0.9rem; font-weight: 700; color: var(--sky-600); margin-bottom: 16px; }
.cert-mock-footer { display: flex; justify-content: space-around; }
.cert-mock-sig { width: 60px; height: 2px; background: var(--gray-300); border-radius: 2px; }

.cert-preview-actions {
  display: flex; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--gray-100); background: var(--gray-50);
}
.cert-action-btn {
  flex: 1; padding: 8px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: var(--transition);
  border: 1.5px solid var(--gray-200); background: white; color: var(--gray-600);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cert-action-btn.active { background: var(--sky-500); color: white; border-color: var(--sky-500); }
.cert-action-btn:hover { border-color: var(--sky-300); }

.floating-badge {
  position: absolute; background: white; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; color: var(--gray-700);
  white-space: nowrap;
}
.badge-1 { bottom: 40px; right: -20px; animation: badgeFloat 4s ease-in-out infinite; }
.badge-2 { top: 40px; left: -30px; animation: badgeFloat 4s ease-in-out infinite reverse; }
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---- Features ---- */
.features {
  position: relative; z-index: 1;
  padding: 100px 40px; max-width: 1280px; margin: 0 auto;
}
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
  border-radius: var(--radius-lg); padding: 32px;
  border: 1px solid rgba(14,165,233,0.1);
  transition: var(--transition-slow);
  cursor: default;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--sky-200);
}
.feature-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.feature-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; }
.feature-card p { font-size: 0.9rem; color: var(--gray-500); line-height: 1.7; }

/* ---- How it Works ---- */
.how-it-works {
  position: relative; z-index: 1;
  padding: 100px 40px; background: linear-gradient(135deg, var(--sky-600), var(--sky-800));
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
  margin: 0;
}
.how-it-works .section-badge { background: rgba(255,255,255,0.2); color: white; }
.how-it-works .section-title { color: white; }
.how-it-works .section-subtitle { color: rgba(255,255,255,0.7); }

.steps-container {
  display: flex; align-items: center; gap: 0;
  max-width: 900px; margin: 0 auto;
  flex-wrap: wrap; justify-content: center;
}
.step {
  display: flex; align-items: center; gap: 20px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
  border-radius: var(--radius-lg); padding: 28px 24px;
  border: 1px solid rgba(255,255,255,0.2);
  flex: 1; min-width: 220px;
}
.step-number {
  font-size: 2.5rem; font-weight: 900; color: rgba(255,255,255,0.2);
  line-height: 1; white-space: nowrap;
}
.step-content h3 { font-size: 1rem; font-weight: 700; color: white; margin-bottom: 6px; }
.step-content p { font-size: 0.82rem; color: rgba(255,255,255,0.7); line-height: 1.5; }
.step-arrow { font-size: 1.5rem; color: rgba(255,255,255,0.4); padding: 0 8px; flex-shrink: 0; }

/* ---- CTA ---- */
.cta-section {
  position: relative; z-index: 1; padding: 100px 40px;
  text-align: center;
}
.cta-card {
  background: rgba(255,255,255,0.9); backdrop-filter: blur(20px);
  border-radius: var(--radius-xl); padding: 60px 40px;
  max-width: 640px; margin: 0 auto;
  border: 1px solid var(--sky-100); box-shadow: var(--shadow-xl);
}
.cta-card h2 { font-size: 1.9rem; font-weight: 800; color: var(--gray-900); margin-bottom: 12px; letter-spacing: -0.5px; }
.cta-card p { color: var(--gray-500); margin-bottom: 32px; }

/* ---- Footer ---- */
.footer {
  position: relative; z-index: 1; padding: 32px 40px;
  border-top: 1px solid var(--sky-100);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(10px);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-copy { font-size: 0.85rem; color: var(--gray-400); }

/* ---- Modal Overlay ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,0.6); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: var(--transition-slow);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-card {
  background: white; border-radius: var(--radius-xl);
  padding: 40px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-xl); position: relative;
  transform: scale(0.95) translateY(16px);
  transition: var(--transition-slow);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.active .modal-card { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gray-100); border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); }

/* ---- Utility ---- */
.hidden { display: none !important; }
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tags */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-info { background: var(--sky-100); color: var(--sky-700); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Toast Notifications */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-md);
  background: white; box-shadow: var(--shadow-xl);
  min-width: 280px; max-width: 380px; pointer-events: all;
  border-left: 4px solid var(--sky-500);
  animation: slideInToast 0.3s ease forwards;
  font-size: 0.875rem; font-weight: 500; color: var(--gray-700);
}
.toast.toast-success { border-color: var(--success); }
.toast.toast-error { border-color: var(--error); }
.toast.toast-warning { border-color: var(--warning); }
.toast.fadeout { animation: fadeOutToast 0.3s ease forwards; }
@keyframes slideInToast {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOutToast {
  to { transform: translateX(100px); opacity: 0; }
}

/* Loading Overlay */
.page-loading {
  position: fixed; inset: 0; z-index: 999;
  background: white; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.page-loading .brand-name { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); }
.page-loading .brand-name span { color: var(--sky-500); }
.loading-bar {
  width: 160px; height: 3px; background: var(--gray-100); border-radius: 100px; overflow: hidden;
}
.loading-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--sky-400), var(--sky-600));
  border-radius: 100px; animation: loadBar 1.2s ease infinite;
}
@keyframes loadBar {
  0% { width: 0%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero { flex-direction: column; text-align: center; padding-top: 100px; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; margin: 0 auto; }
  .hero-visual { width: 100%; }
}
@media (max-width: 768px) {
  .navbar { padding: 14px 20px; }
  .navbar.scrolled { padding: 10px 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 90px 20px 60px; }
  .features { padding: 60px 20px; }
  .how-it-works { padding: 80px 20px; clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%); }
  .steps-container { flex-direction: column; }
  .step-arrow { display: none; }
  .section-title { font-size: 1.7rem; }
  .cert-card-preview { width: 300px; }
  .badge-1, .badge-2 { display: none; }
  .footer { flex-direction: column; gap: 16px; text-align: center; }
  .cta-section { padding: 60px 20px; }
}
