:root {
  --navy-950: #050c15;
  --navy-900: #0a1625;
  --navy-800: #102238;
  --navy-700: #17314d;
  --slate-600: #6e7d91;
  --slate-500: #93a2b7;
  --slate-400: #b8c4d4;
  --gold-500: #a4bdfd;
  --gold-400: #dbeafe;
  --gold-300: #eff6ff;
  --cream: #07111d;
  --white: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(59, 130, 246, 0.1), transparent 22%),
    linear-gradient(180deg, #04070d 0%, #07111d 42%, #0a1625 100%);
  color: #e2e8f0;
  line-height: 1.6;
  position: relative;
}

/* Decorative background elements */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.serif {
  font-family: 'Cormorant Garamond', serif;
}

.ld-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.page-pad {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* Navigation */
.site-nav {
  background: rgba(5, 12, 21, 0.82);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: clamp(160px, 18vw, 230px);
  height: auto;
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: translateX(4px);
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(10, 14, 39, 0.15);
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--slate-500);
  font-weight: 500;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #03111f;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #eff6ff 0%, #bfdbfe 100%);
  border: 1px solid rgba(147, 197, 253, 0.35);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.22);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  color: #03111f;
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.28);
}

.nav-link:active {
  transform: translateY(0);
}

.nav-link:focus-visible {
  outline: 3px solid rgba(191, 219, 254, 0.35);
  outline-offset: 2px;
}

.nav-link-secondary {
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: none;
}

.nav-link-secondary:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.72);
  box-shadow: none;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.back-button:hover {
  background: rgba(30, 41, 59, 0.76);
}

/* Hero Section */
.hero {
  margin: 4rem 0;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-card {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  border-radius: 24px;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(10, 14, 39, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Form card enhancement for Generate page */
.form-section-card,
.card {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(10,14,39,0.06);
  border: 1px solid rgba(10,14,39,0.04);
}

.form-section-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  color: var(--navy-900);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-hint, .form-tip {
  color: var(--slate-500);
  font-size: 0.9rem;
}

.form-input, input[type="text"], input[type="email"], input[type="date"], input[type="number"], input[type="tel"], textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(10,14,39,0.08);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  font-size: 0.95rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
}

textarea { min-height: 96px; }

.form-input:focus, input:focus, textarea:focus {
  outline: none;
  border-color: rgba(59,130,246,0.9);
  box-shadow: 0 6px 20px rgba(59,130,246,0.06);
  transform: translateY(-1px);
}

.form-footer {
  background: transparent;
  border-top: none;
  padding: 1rem 0 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.generate-actions { display: flex; gap: 0.75rem; }

.btn-ghost {
  background: white;
  color: var(--navy-900);
  border: 1px solid rgba(10,14,39,0.06);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
}

/* Responsive tweak */
@media (max-width: 900px) {
  .templates-grid { grid-template-columns: 1fr; }
  .nav-content { padding: 1rem; }
}

/* Decorative elements */
.hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

.hero-card::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  border-radius: 50%;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 3rem;
    align-items: center;
  }
}

.hero-content h2 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero-content p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
  max-width: 600px;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold-300);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.badge:hover {
  background: rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
}

.quick-start {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
}

.quick-start h3 {
  font-size: 1.5rem;
  color: var(--gold-300);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.quick-start ol {
  list-style: none;
  counter-reset: step;
}

.quick-start li {
  counter-increment: step;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quick-start li::before {
  content: counter(step);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

/* Form Section */
.form-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin: 5rem 0;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

@media (min-width: 1024px) {
  .form-section {
    grid-template-columns: 0.95fr 1.05fr;
    align-items: start;
  }
}

.form-info h3 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.form-info p {
  font-size: 1.05rem;
  color: var(--slate-600);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.info-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(10, 14, 39, 0.08);
  box-shadow: 0 8px 32px rgba(10, 14, 39, 0.06);
}

.info-card h4 {
  font-size: 1.25rem;
  color: var(--navy-900);
  margin-bottom: 1rem;
  font-weight: 600;
}

.info-card ol {
  list-style: none;
  counter-reset: process;
}

.info-card li {
  counter-increment: process;
  padding: 0.75rem 0;
  display: flex;
  gap: 1rem;
  color: var(--slate-600);
  font-weight: 500;
}

.info-card li::before {
  content: counter(process);
  color: var(--gold-500);
  font-weight: 700;
  min-width: 20px;
}

.form-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(10, 14, 39, 0.1);
  box-shadow:
    0 20px 60px rgba(10, 14, 39, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  backdrop-filter: blur(20px);
  transition: transform 0.3s ease;
}

.form-card:hover {
  transform: translateY(-4px);
}

.form-header {
  background: linear-gradient(135deg, rgba(10, 14, 39, 0.04) 0%, rgba(212, 175, 55, 0.03) 100%);
  border-bottom: 1px solid rgba(10, 14, 39, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.form-header-text h4 {
  font-size: 1.5rem;
  color: var(--navy-900);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.form-header-text p {
  color: var(--slate-500);
  font-size: 0.95rem;
  margin: 0;
}

.upload-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--slate-500);
  font-size: 0.875rem;
  font-weight: 600;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-top: 2px solid var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.form-body {
  display: grid;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 700;
  color: var(--navy-900);
  font-size: 0.95rem;
}

.form-input {
  padding: 0.875rem 1rem;
  border: 1.5px solid rgba(10, 14, 39, 0.15);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
  background: var(--white);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin: 0;
}

.file-upload-area {
  border: 2px dashed rgba(10, 14, 39, 0.2);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  position: relative;
}

.file-upload-area:hover {
  border-color: var(--gold-500);
  background: rgba(212, 175, 55, 0.04);
  transform: translateY(-2px);
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-500);
}

.upload-icon svg {
  width: 32px;
  height: 32px;
}

.file-upload-text {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.file-upload-label {
  color: var(--navy-900);
  font-weight: 700;
  cursor: pointer;
}

.file-upload-hint {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin: 0.5rem 0 0;
}

#selected-file {
  display: block;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--navy-900);
  background: rgba(212, 175, 55, 0.12);
  padding: 0.75rem 1rem;
  border-radius: 12px;
}

.form-footer {
  background: rgba(10, 14, 39, 0.02);
  border-top: 1px solid rgba(10, 14, 39, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-tip {
  font-size: 0.9rem;
  color: var(--slate-600);
  margin: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: var(--gold-400);
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(10, 14, 39, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10, 14, 39, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(212, 175, 55, 0.35);
  outline-offset: 2px;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 14, 39, 0.15), transparent);
  margin: 4rem 0;
}

/* Templates Section */
.templates-section {
  margin-bottom: 5rem;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.templates-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.templates-header h3 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}

.templates-meta {
  color: var(--slate-500);
  font-weight: 600;
  font-size: 0.95rem;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

/* Template card adjustments */
.template-card .card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 120px;
  padding: 0.9rem;
}

.template-card .card-body {
  padding-right: 1rem;
}

.template-card .card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Smaller primary button when used inside the templates grid */
.templates-grid .btn-primary.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  border-radius: 8px;
  box-shadow: none;
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
}

/* Remove shiny overlay and heavy hover for small CTAs */
.templates-grid .btn-primary.btn-sm::before { display: none; }
.templates-grid .btn-primary.btn-sm:hover { transform: none; box-shadow: 0 6px 12px rgba(10,14,39,0.08); }

.template-placeholder {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  border: 1px solid rgba(10, 14, 39, 0.08);
  color: var(--slate-500);
}

/* Responsive */
@media (max-width: 1200px) {
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-content {
    padding: 1.25rem 1.5rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-card {
    padding: 2.5rem 2rem;
  }

  .form-section {
    margin: 4rem 0;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }

  .form-header,
  .form-body,
  .form-footer {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .ld-container {
    padding: 0 1.25rem;
  }

  .nav-content {
    padding: 1rem 1.25rem;
  }

  .brand-logo {
    width: 170px;
  }
}
