/* =========================
   BASE LAYOUT
   ========================= */

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

body {
  font-family: 'Inter', sans-serif;
  background: #f8fafc;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  overflow-x: hidden; /* prevent horizontal crop issues */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: #0f172a;
  margin: 0;
  padding: 0;
}

body > h2,
body > p {
  text-align: center;
}

body > h2 {
  margin-top: 40px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

body > p {
  margin-bottom: 30px;
}

/* =========================
   TYPOGRAPHY
   ========================= */

h2 {
  margin-bottom: 6px;
  font-size: 26px;
}

h3 {
  margin-bottom: 10px;
}

h4 {
  margin-bottom: 8px;
}

label {
  font-weight: 600;
  margin-top: 16px;
  display: block;
  font-size: 14px;
  color: #374151;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

/* =========================
   INPUTS
   ========================= */

input,
textarea {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

textarea {
  min-height: 90px;
}

/* =========================
   BUTTONS
   ========================= */

button {
  width: 100%;
  padding: 14px;
  margin-top: 14px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
  transition: all 0.25s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

/* =========================
   BOX
   ========================= */

.box {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);

  padding: 32px;
  margin: 40px auto;

  border-radius: 18px;

  box-shadow:
    0 10px 30px rgba(15,23,42,0.06),
    0 1px 2px rgba(15,23,42,0.04);

  border: 1px solid rgba(148,163,184,0.15);

  max-width: 1000px;
}

.box:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 18px rgba(15, 23, 42, 0.06),
    0 18px 40px rgba(15, 23, 42, 0.08);
}

/* =========================
   USAGE METER
   ========================= */

.usage-box {
  margin-top: 12px;
}

.usage-header {
  display: flex;
  justify-content: space-between;
}

.usage-bar {
  height: 12px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.usage-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  transition: width 0.3s ease;
}

/* =========================
   PRICING
   ========================= */

/* ===============================
   STRIPE-STYLE PRICING
================================ */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;

  width: 100%;
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;

  position: relative;
  z-index: 2;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.pricing-card.selected {
  border: 2px solid #6366f1;
}

.pricing-card h4 {
  font-size: 20px;
  margin-bottom: 10px;
}

.pricing-card .price {
  font-size: 32px;
  font-weight: 700;
  margin: 10px 0;
}

.choose-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  color: white;
  border: none;
  font-weight: 600;
  margin-top: 20px;
  cursor: pointer;
  transition: 0.3s;
}

.choose-btn:hover {
  transform: translateY(-2px);
}

.pricing-card.recommended {
  border: 2px solid #6366f1;
  background: linear-gradient(180deg, #ffffff, #eef2ff);
}

/* =========================
   BILLING TOGGLE
   ========================= */

.billing-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.switch {
  position: relative;
  width: 42px;
  height: 22px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background: #6366f1;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* =========================
   MODAL
   ========================= */

.upgrade-modal {
  background: #ffffff;
  border-radius: 18px;
  padding: 26px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

/* =========================
   BILLING BOX
   ========================= */

.billing-box {
  background: linear-gradient(180deg, #ffffff, #f9fafb);
  border-radius: 18px;
  padding: 24px;
  margin-top: 30px;
}

.payment-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
}

.modal-content {
  position: relative;
}

/* =========================
   MODAL FIX
========================= */

.hidden {
  display: none !important;
}

.upgrade-modal {
  background: #ffffff;
  border-radius: 18px;
  padding: 26px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: #111827;
}

.pricing-card.selected {
  border: 2px solid #5b5fff;
  box-shadow: 0 0 0 2px rgba(91, 95, 255, 0.15);
}

.pricing-card.selected button {
  background: #4f46e5;
}

.pricing-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 26px;
  border: 1px solid #e5e7eb;
  text-align: center;
  position: relative;
  transition: all 0.25s ease;

  width: 100%;              /* ✅ Add this */
  box-sizing: border-box;   /* ✅ Add this */
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(15,23,42,0.08);
}

.pricing-card.selected {
  border: 2px solid #6366f1;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

#analysisResults ul {
  margin-top: 8px;
  padding-left: 18px;
}

#analysisResults li {
  margin-bottom: 6px;
}

.score-container {
  text-align: center;
  margin: 20px 0;
}

.score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 26px;
  font-weight: 700;

  background: conic-gradient(
    #22c55e 0%,
    #22c55e var(--score),
    #e5e7eb var(--score),
    #e5e7eb 100%
  );

  color: #0f172a;
}

.score-label {
  margin-top: 8px;
  font-size: 14px;
  color: #6b7280;
}

.heatmap-box {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 14px;
  line-height: 1.6;
}

.keyword-match {
  background: #dcfce7;
  color: #065f46;
  padding: 2px 6px;
  border-radius: 6px;
}

.keyword-missing {
  background: #fee2e2;
  color: #7f1d1d;
  padding: 2px 6px;
  border-radius: 6px;
}

/* =========================
   SIDE BY SIDE UI
========================= */

.comparison-section {
  margin-top: 30px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 15px;
}

.comparison-box {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;

  border: 1px solid #e5e7eb;

  box-shadow: 0 6px 20px rgba(15,23,42,0.05);

  transition: all 0.2s ease;
}

.comparison-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

.comparison-content {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.highlight-match {
  background-color: #d1fae5;
  padding: 2px 4px;
  border-radius: 4px;
}

.highlight-missing {
  background-color: #fee2e2;
  padding: 2px 4px;
  border-radius: 4px;
}

.analyzer-section {
  margin-top: 40px;
}

.analyzer-section textarea {
  margin-top: 14px;
  min-height: 130px;
}

#analysisResults {
  margin-top: 30px;
  background: linear-gradient(180deg, #ffffff, #f9fafb);
}

.hidden {
  display: none !important;
}

#analysisResults,
#comparisonSection {
  animation: fadeIn 0.4s ease;
}

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

h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}

.muted {
  color: #64748b;
}

.hero {
  padding: 120px 20px 80px;
  text-align: center;
  background: linear-gradient(
    -45deg,
    #6366f1,
    #8b5cf6,
    #ec4899,
    #3b82f6
  );
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  color: white;
margin-top: 72px;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-sub {
  color: rgba(255,255,255,0.85);
}

.hero-content {
  max-width: 900px;
  margin: auto;
}

.hero-sub {
  font-size: 18px;
  color: #475569;
  max-width: 700px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.hero-points {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 500;
  color: #334155;
}

.why-section {
  padding: 80px 20px;
  text-align: center;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: auto;
  margin-top: 40px;
}

.why-card {
  background: #ffffff;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  transition: all 0.25s ease;
  box-shadow: 0 8px 25px rgba(0,0,0,0.04);
}

.why-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px rgba(0,0,0,0.08);
}

.why-card h4 {
  margin-bottom: 12px;
}

section {
  margin-top: 40px;
}

/* ===============================
   TRUST BADGE CAROUSEL
================================ */

.trust-strip {
  background: #0f172a;
  color: white;
  overflow: hidden;
  padding: 12px 0;
  white-space: nowrap;
  position: relative;
}

.trust-track {
  display: inline-block;
  animation: scrollTrust 25s linear infinite;
}

.trust-track span {
  margin: 0 40px;
  font-weight: 500;
  opacity: 0.9;
}

@keyframes scrollTrust {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.how-section {
  padding: 80px 20px;
  text-align: center;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-top: 50px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.how-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  transition: 0.3s ease;
}

.how-card:hover {
  transform: translateY(-8px);
}

.step-number {
  width: 50px;
  height: 50px;
  background: #6366f1;
  color: white;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.testimonials {
  padding: 80px 20px;
  background: #f8fafc;
  text-align: center;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin-top: 40px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.testimonial-card {
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  font-style: italic;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 72px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0 60px;   /* ← More breathing room */

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);

  border-bottom: 1px solid #e5e7eb;

  z-index: 9999;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-weight: 800;
  font-size: 20px;
}

.dark-toggle {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;

  border: none;
  padding: 8px 16px;

  border-radius: 999px;  /* pill shape */
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.3s ease;
}

.dark-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99,102,241,0.4);
}

.dark-toggle:hover {
  transform: scale(1.05);
}

.dark-mode {
  background: #0f172a;
  color: #e2e8f0;
}

.dark-mode .box,
.dark-mode .how-card,
.dark-mode .testimonial-card,
.dark-mode .why-card {
  background: #1e293b;
  color: #e2e8f0;
}

.dark-mode .navbar {
  background: rgba(15,23,42,0.9);
}

button {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;

  padding: 12px 22px;
  border-radius: 10px;

  font-weight: 600;
  font-size: 14px;

  cursor: pointer;
  transition: all 0.25s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(99,102,241,0.3);
}

body.dark {
  background: #0f172a;
  color: #f1f5f9;
}

body.dark .box {
  background: #1e293b;
  border: 1px solid #334155;
  box-shadow: none;
}

body.dark input,
body.dark textarea {
  background: #0f172a;
  border: 1px solid #334155;
  color: white;
}

body.dark .comparison-box {
  background: #1e293b;
  border: 1px solid #334155;
}

h2, h3 {
  font-weight: 700;
  margin-bottom: 16px;
}

/* ===============================
   FLOATING BACKGROUND SHAPES
================================ */

.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: -1;   /* 🔥 change to -1 */
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s infinite ease-in-out;
}

.shape1 {
  width: 400px;
  height: 400px;
  background: #6366f1;
  top: -100px;
  left: -100px;
}

.shape2 {
  width: 500px;
  height: 500px;
  background: #8b5cf6;
  bottom: -150px;
  right: -100px;
  animation-delay: 5s;
}

.shape3 {
  width: 350px;
  height: 350px;
  background: #22c55e;
  top: 40%;
  left: 60%;
  animation-delay: 8s;
}

@keyframes float {
  0% { transform: translateY(0px) }
  50% { transform: translateY(-40px) }
  100% { transform: translateY(0px) }
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

#analyzeBtn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  transition: all 0.3s ease;
}

#analyzeBtn::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.2);
  top: 0;
  left: -100%;
  transition: 0.5s;
}

#analyzeBtn:hover::after {
  left: 100%;
}

#analyzeBtn:active {
  transform: scale(0.97);
}

/* ===============================
   HEATMAP GRAPH
================================ */

.heatmap-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.keyword-chip {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.3s;
}

.keyword-chip:hover {
  transform: scale(1.1);
}

.hidden {
  display: none !important;
}

/* =========================
   GLASS LOGIN MODAL
========================= */

/* =========================
   MODAL BACKDROP
========================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

/* =========================
   LOGIN CARD
========================= */

.login-modal {
  position: relative;
  width: 100%;
  max-width: 420px;

  background: #ffffff;
  border-radius: 20px;
  padding: 40px 36px 36px;

  box-shadow:
    0 20px 50px rgba(0,0,0,0.15),
    0 4px 10px rgba(0,0,0,0.06);

  text-align: center;

  animation: modalFade 0.25s ease;
}

/* Smooth pop animation */
@keyframes modalFade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   HEADER
========================= */

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

.login-header h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-header p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

/* =========================
   INPUT
========================= */

.login-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  margin-bottom: 16px;
  transition: all 0.25s ease;
}

.login-form input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* =========================
   BUTTON
========================= */

.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;

  font-weight: 600;
  font-size: 14px;
  cursor: pointer;

  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;

  transition: all 0.25s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.3);
}

/* =========================
   CLOSE BUTTON
========================= */

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  transition: 0.2s ease;
}

.modal-close:hover {
  color: #111827;
}

.score-status {
  margin-top: 10px;
  font-weight: 600;
  font-size: 14px;
}

.keyword-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.keyword-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  transition: width 0.6s ease;
}

.active-plan {
  border: 2px solid #10b981;
  transform: scale(1.03);
}

.active-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #10b981;
  color: white;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(16,185,129,0.3);
}

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #111;
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.days-left {
  font-weight: 600;
  color: #10b981;
  margin-top: 4px;
}

.countdown-wrapper {
  margin-top: 15px;
  display: flex;
  justify-content: center;
}

.countdown-circle {
  position: relative;
  width: 120px;
  height: 120px;
}

.countdown-circle svg {
  transform: rotate(-90deg);
}

.countdown-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-weight: 600;
}

.countdown-text span {
  font-size: 22px;
  display: block;
}

.countdown-text small {
  font-size: 12px;
  color: #666;
}

.active-plan {
  border: 2px solid #10b981;
  position: relative;
}

.active-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #10b981;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
}

.disabled-plan {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.disabled-plan::after {
  content: "Current plan active";
  position: absolute;
  top: 10px;
  right: 10px;
  background: #10b981;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 20px;
}

.nav-user {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.logout-btn {
  background: #ef4444;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  width: auto;
}

.logout-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* ===== Fix Close Button Layout ===== */

.modal-close {
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* ===== Fix Login Input Alignment ===== */

.login-form {
  text-align: left;
}

.login-form input {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* ===== Login Button Loader ===== */

.login-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.login-btn.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid white;
  border-top: 2px solid transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

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

.nav-user,
.logout-btn {
  display: flex;
  align-items: center;
  height: 40px;
}