/* Nefru Labs Landing */
:root {
  --primary: #1a5f7a;
  --primary-dark: #0e3d4d;
  --text: #222;
  --text-muted: #555;
  --bg: #fafafa;
  --card: #fff;
  --border: #e0e0e0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; }

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
nav a { color: var(--primary); text-decoration: none; margin-left: 1.5rem; font-weight: 500; }
nav a:hover { text-decoration: underline; }

/* ========== Main nav with dropdown + auth button ========== */
.nav-main {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 2rem;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-logo {
  font-weight: 800;
  font-size: 1.2rem;
  margin-left: 0;
  color: var(--primary-dark);
}
.nav-divider {
  width: 1px;
  height: 26px;
  background: var(--border);
  margin-left: 0.75rem;
  margin-right: 0.5rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-links > a {
  margin-left: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-links > a:hover { background: rgba(26, 95, 122, 0.08); text-decoration: none; }
.nav-dropdown {
  position: relative;
}
.nav-dropdown > a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}
.nav-dropdown .arrow { font-size: 0.65em; opacity: 0.8; }
.nav-dropdown:hover > a { background: rgba(26, 95, 122, 0.08); text-decoration: none; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  margin-top: 2px;
  padding: 0.5rem 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  margin: 0;
  color: var(--text);
  border-radius: 0;
}
.nav-dropdown-menu a:hover { background: rgba(26, 95, 122, 0.08); color: var(--primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  visibility: hidden;
}
/* Shown only after site.js sets Log in/Profile state (no flash on refresh) */
.nav-right.nav-auth-ready {
  visibility: visible;
}
.nav-auth-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(26,95,122,0.25);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.nav-auth-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(26,95,122,0.35);
}
.nav-auth-btn.secondary {
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid rgba(26,95,122,0.3);
  box-shadow: none;
}
.nav-auth-btn.secondary:hover {
  background: rgba(26,95,122,0.05);
  box-shadow: none;
}

/* ========== Login Modal ========== */
.login-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.login-modal.active {
  display: flex;
}
.login-modal-content {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}
.login-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.login-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}
.login-modal h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: var(--primary-dark);
}
.login-modal .form-row {
  margin-bottom: 1.25rem;
}
.login-modal label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}
.login-modal input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.login-modal input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}
.login-modal button[type="submit"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease, transform 0.15s ease;
  margin-top: 0.5rem;
}
.login-modal button[type="submit"]:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}
.login-modal button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-modal-error {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 6px;
  color: #c33;
  font-size: 0.9rem;
  display: none;
}
.login-modal-error.visible {
  display: block;
}
.login-modal-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.login-modal-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.login-modal-footer a:hover {
  text-decoration: underline;
}

/* ========== Site footer (two lines, small) ========== */
.site-footer {
  text-align: center;
  padding: 1.5rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--card);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.site-footer p { margin: 0.25rem 0; }
.site-footer .footer-legal { font-size: 0.75rem; color: var(--text-muted); opacity: 0.9; }
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ========== Section scroll reveal ========== */
.section-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.section-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.section-reveal.revealed .animate-on-reveal { animation: fadeInUp 0.6s ease-out forwards; }

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

/* ========== Hero (homepage) ========== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #0e3d4d 0%, #1a5f7a 40%, #2d7a96 100%);
  z-index: 0;
}
.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}
.hero-content h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.hero-content .hero-tagline {
  color: rgba(255,255,255,0.92);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}
.hero-cta {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-cta a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-cta .btn-primary {
  background: #fff;
  color: var(--primary-dark);
}
.hero-cta .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.hero-cta .btn-secondary {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
}
.hero-cta .btn-secondary:hover { background: rgba(255,255,255,0.25); transform: translateY(-2px); }

/* ========== Homepage sections ========== */
.home-section {
  padding: 4.5rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}
.home-section:nth-child(even) { background: var(--card); }
.home-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 0;
  margin-bottom: 1rem;
}
.home-section .section-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 2rem;
}

/* ========== Before / After slider ========== */
.before-after {
  max-width: 900px;
  margin: 1.5rem auto 0;
}
.before-after-inner {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.before-after-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.before-after .before-after-overlay {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid #fff;
  box-shadow: 4px 0 12px rgba(0,0,0,0.15);
}
.before-after .before-after-slider {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  width: 40%;
  margin: 0 auto;
  z-index: 2;
}

/* ========== Responsive tweaks (mobile & tablet) ========== */
@media (max-width: 900px) {
  .nav-main {
    padding: 0.5rem 1.25rem;
  }
  .nav-left {
    gap: 0.75rem;
  }
  .nav-logo {
    font-size: 1.05rem;
  }
  .nav-links > a {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
  }
  .hero {
    min-height: 70vh;
    padding: 3rem 1.5rem;
  }
  .home-section {
    padding: 3.25rem 1.5rem;
  }
  .pricing-grid {
    padding: 0 0.25rem;
  }
}

@media (max-width: 640px) {
  .nav-main {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .nav-left {
    width: 100%;
    justify-content: space-between;
  }
  .nav-divider {
    display: none;
  }
  .nav-links {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
  .nav-links > a {
    padding: 0.35rem 0.4rem;
    font-size: 0.85rem;
  }
  .nav-right {
    width: 100%;
    justify-content: flex-end;
  }
  .nav-auth-btn {
    padding-inline: 1rem;
    font-size: 0.9rem;
  }

  .hero {
    min-height: 60vh;
    padding: 2.5rem 1.25rem;
  }
  .hero-content h1 {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }
  .hero-content .hero-tagline {
    font-size: 0.95rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-placeholder {
    height: 260px;
  }

  .home-section {
    padding: 2.75rem 1.25rem;
  }
  .home-section .section-lead {
    font-size: 1rem;
  }

  .before-after .before-after-slider {
    width: 70%;
  }

  .profile-grid {
    grid-template-columns: minmax(0,1fr);
  }

  .signup-form,
  .login-card,
  .profile-wrap {
    margin-inline: 0.5rem;
  }
}
.hero-placeholder {
  width: 100%;
  max-width: 900px;
  height: 420px;
  margin: 2rem auto;
  background: linear-gradient(135deg, rgba(26,95,122,0.15) 0%, rgba(14,61,77,0.25) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 500;
  border: 2px dashed rgba(26,95,122,0.3);
}
.success-box {
  text-align: center;
  padding: 2.5rem;
  background: var(--card);
  border: 2px solid #22c55e;
  border-radius: 12px;
  max-width: 480px;
  margin: 3rem auto;
}
.success-box h1 { color: #166534; margin-top: 0; font-size: 1.5rem; }
.success-box p { color: var(--text); margin: 1rem 0; }

.container { max-width: 960px; margin: 0 auto; padding: 2rem; }
h1 { color: var(--primary-dark); margin-top: 0; }
h2 { color: var(--primary); margin-top: 2rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card a { color: var(--primary); font-weight: 500; }

.product-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.product-nav a { padding: 0.5rem 1rem; background: var(--primary); color: #fff; text-decoration: none; border-radius: 6px; }
.product-nav a:hover { background: var(--primary-dark); }

.dl-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.dl-table th, .dl-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.dl-table th { background: var(--bg); color: var(--primary-dark); }
.dl-table .soon { color: var(--text-muted); font-style: italic; }
.dl-table .btn { display: inline-block; padding: 0.4rem 0.8rem; background: var(--primary); color: #fff; text-decoration: none; border-radius: 4px; border: none; cursor: pointer; }
.dl-table .btn:hover { background: var(--primary-dark); }
.dl-table .btn.soon { background: #999; cursor: not-allowed; }
.dl-table .action-soon { display: inline-block; padding: 0.4rem 0.8rem; color: var(--text-muted); font-size: 0.9rem; font-style: italic; }

footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.9rem; margin-top: 3rem; border-top: 1px solid var(--border); }
footer a { color: var(--primary); }/* ========== Pricing page ========== */
.pricing-hero { text-align: center; margin-bottom: 2.5rem; }
.pricing-hero h1 { margin-bottom: 0.5rem; }
.pricing-hero .sub { color: var(--text-muted); font-size: 1.05rem; }.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
}
.pricing-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.75rem;
  border: 2px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  position: relative;
}
.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.pricing-card.tier-starter { --tier: #22c55e; border-color: rgba(34, 197, 94, 0.4); }
.pricing-card.tier-starter:hover { border-color: var(--tier); box-shadow: 0 12px 28px rgba(34, 197, 94, 0.15); }
.pricing-card.tier-pro { --tier: #eab308; border-color: rgba(234, 179, 8, 0.5); }
.pricing-card.tier-pro:hover { border-color: var(--tier); box-shadow: 0 14px 32px rgba(234, 179, 8, 0.2); }
.pricing-card.tier-studio { --tier: #3b82f6; border-color: rgba(59, 130, 246, 0.4); }
.pricing-card.tier-studio:hover { border-color: var(--tier); box-shadow: 0 12px 28px rgba(59, 130, 246, 0.15); }
.pricing-card.tier-power { --tier: #ef4444; border-color: rgba(239, 68, 68, 0.4); }
.pricing-card.tier-power:hover { border-color: var(--tier); box-shadow: 0 12px 28px rgba(239, 68, 68, 0.15); }.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tier);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pricing-card .tier-name { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.pricing-card .tier-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.25rem; min-height: 2.5em; }
.pricing-card .price { font-size: 2.25rem; font-weight: 800; color: var(--tier); margin-bottom: 0.25rem; }
.pricing-card .credits { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.pricing-card .cta {
  display: block;
  text-align: center;
  padding: 0.65rem 1rem;
  background: var(--tier);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: filter 0.2s ease, transform 0.15s ease;
}
.pricing-card .cta:hover { filter: brightness(1.1); transform: scale(1.02); }
.pricing-card .cta:active { transform: scale(0.98); }.pricing-note {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.pricing-note strong { color: var(--text); }

/* ========== Multisheet Builder slider ========== */
.msb-slider {
  max-width: 960px;
  margin: 0 auto;
}
.msb-slider-viewport {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}
.msb-slider-track {
  position: relative;
}
.msb-slide {
  display: none;
  padding: 1.25rem 1.25rem 1rem;
}
.msb-slide.active {
  display: block;
}
.msb-slide img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
.msb-slide figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}
.msb-slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.msb-slider-btn {
  border: none;
  background: rgba(26,95,122,0.06);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.msb-slider-btn:hover {
  background: rgba(26,95,122,0.14);
}
.msb-slider-dots {
  display: flex;
  gap: 0.4rem;
}
.msb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(148,163,184,0.8);
  cursor: pointer;
  padding: 0;
}
.msb-dot.active {
  background: var(--primary);
}

/* ========== Multisheet Builder slider ========== */
.msb-slider {
  margin-top: 1.5rem;
}
.msb-slider-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}
.msb-slider-track {
  position: relative;
}
.msb-slide {
  display: none;
  margin: 0;
}
.msb-slide.active {
  display: block;
}
.msb-slide img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--border);
}
.msb-slide figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: #f8fafc;
}
.msb-slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.msb-slider-btn {
  border: none;
  background: var(--card);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--primary-dark);
  box-shadow: 0 4px 10px rgba(15,23,42,0.08);
}
.msb-slider-btn:hover {
  background: rgba(26,95,122,0.06);
}
.msb-slider-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.msb-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(15,23,42,0.16);
  padding: 0;
  cursor: pointer;
}
.msb-dot.active {
  width: 18px;
  background: var(--primary);
}

@media (max-width: 768px) {
  .msb-slide figcaption {
    padding: 0.6rem 0.85rem;
  }
}