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

:root {
  --primary: #26baa5;
  --primary-dark: #159b89;
  --secondary: #375f7a;
  --secondary-dark: #294a61;
  --ink: #18303f;
  --muted: #687983;
  --surface: #ffffff;
  --background: #f3f7f8;
  --line: #dbe5e8;
  --shadow: 0 18px 55px rgba(35, 77, 96, 0.12);
  --radius-lg: 24px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: 'Manrope', Arial, sans-serif;
  line-height: 1.6;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(55, 95, 122, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.header-content { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { width: auto; height: 50px; object-fit: contain; }
.header-nav { display: flex; gap: 30px; color: var(--secondary); font-size: 0.92rem; font-weight: 700; }
.header-nav a { transition: color 0.2s ease; }
.header-nav a:hover { color: var(--primary-dark); }

.hero {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(125deg, #294e67 0%, var(--secondary) 50%, #337990 100%);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(circle at center, #fff 1.3px, transparent 1.3px);
  background-size: 26px 26px;
}

.hero-content { position: relative; z-index: 2; padding-block: 90px; text-align: center; }
.eyebrow, .section-kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 800; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #d5fffa; }
.hero h1 { max-width: 820px; margin: 18px auto; font-size: clamp(2.7rem, 7vw, 5.5rem); line-height: 1.02; letter-spacing: -0.055em; }
.hero h1 span { color: var(--primary); }
.hero p { max-width: 620px; margin: 0 auto 32px; color: #e1edf2; font-size: clamp(1rem, 2vw, 1.15rem); }
.hero-action { display: inline-flex; align-items: center; gap: 10px; padding: 13px 21px; border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; font-weight: 700; transition: 0.2s ease; }
.hero-action:hover { color: var(--secondary-dark); background: #fff; transform: translateY(-2px); }
.hero-shape { position: absolute; z-index: 1; border: 1px solid rgba(38,186,165,0.4); border-radius: 50%; }
.hero-shape-one { width: 320px; height: 320px; top: -150px; right: -90px; }
.hero-shape-two { width: 190px; height: 190px; bottom: -95px; left: 7%; background: rgba(38,186,165,0.08); }

.generator-section { padding: 100px 0; }
.section-heading { max-width: 670px; margin: 0 auto 42px; text-align: center; }
.section-kicker { color: var(--primary-dark); }
.section-heading h2, .author-copy h2 { margin: 7px 0 10px; color: var(--secondary-dark); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.035em; }
.section-heading p, .author-copy p { margin: 0; color: var(--muted); }

.generator-card { max-width: 860px; margin: auto; padding: 34px; border: 1px solid #e7eef0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.fields-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.field > span { display: block; margin-bottom: 8px; font-size: 0.88rem; font-weight: 800; color: var(--secondary-dark); }
.input-wrap { position: relative; }
.input-wrap i { position: absolute; top: 50%; left: 16px; color: var(--primary-dark); transform: translateY(-50%); }
.input-wrap input { width: 100%; height: 54px; padding: 0 16px 0 45px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: #fbfdfd; transition: 0.2s ease; }
.input-wrap input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(38,186,165,0.12); }
.form-message { min-height: 24px; margin: 10px 0 4px; color: #b33a3a; font-size: 0.88rem; font-weight: 600; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.button { min-height: 48px; padding: 0 21px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 800; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { opacity: 0.42; cursor: not-allowed; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 9px 22px rgba(38,186,165,0.26); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: #fff; background: var(--secondary); }
.button-outline { color: var(--secondary); border: 1px solid var(--secondary); background: transparent; }
.button-pdf { color: #fff; background: #c63f46; }
.button-pdf:hover { background: #a92e35; }

.results { margin-top: 72px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.results-heading h2 { margin: 5px 0 0; color: var(--secondary-dark); font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.2; }
.range-badge { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; color: var(--secondary); background: #e2edef; font-size: 0.88rem; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { min-height: 112px; display: flex; align-items: center; gap: 16px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.stat-card i { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--secondary); background: #edf3f5; }
.stat-card span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.stat-card strong { display: block; margin-top: 2px; color: var(--secondary-dark); font-size: 1.7rem; line-height: 1.2; }
.stat-featured { color: #fff; border-color: var(--primary); background: var(--primary); }
.stat-featured i { color: #fff; background: rgba(255,255,255,0.18); }
.stat-featured span, .stat-featured strong { color: #fff; }
.prime-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 12px; }
.prime-number { min-height: 72px; display: grid; place-items: center; border: 1px solid #dbe7e8; border-radius: 13px; color: var(--secondary-dark); background: #fff; font-size: 1.08rem; font-weight: 800; box-shadow: 0 6px 18px rgba(55,95,122,0.05); animation: reveal 0.35s ease both; }
.prime-number:nth-child(5n+1) { border-bottom: 3px solid var(--primary); }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.empty-result { padding: 50px 20px; text-align: center; border: 1px dashed #c8d7db; border-radius: var(--radius-md); color: var(--muted); background: #fff; }
.empty-result i { font-size: 2.2rem; color: var(--primary); }
.print-header, .print-date { display: none; }

.author-section { padding: 85px 0; color: #fff; background: var(--secondary-dark); }
.author-card { display: grid; grid-template-columns: minmax(230px, 360px) 1fr; align-items: center; gap: clamp(40px, 8vw, 90px); }
.author-photo-wrap { position: relative; }
.author-photo { position: relative; z-index: 2; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 32px 8px 32px 8px; background: #fff; }
.photo-accent { position: absolute; right: -16px; bottom: -16px; width: 70%; height: 70%; border: 3px solid var(--primary); border-radius: 30px 8px 30px 8px; }
.author-copy .section-kicker { color: var(--primary); }
.author-copy h2 { color: #fff; }
.author-copy p { max-width: 630px; color: #cbd9e1; }
.social-links { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 27px; }
.social-links a { min-height: 42px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; color: #e8f2f5; font-size: 0.82rem; font-weight: 700; transition: 0.2s ease; }
.social-links a:hover { color: var(--secondary-dark); border-color: var(--primary); background: var(--primary); transform: translateY(-2px); }

.site-footer { color: #9fb0b9; background: #162d3b; }
.footer-content { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 0.84rem; }
.footer-content a { color: #dce7eb; font-weight: 700; }
.whatsapp-button { position: fixed; z-index: 30; right: 24px; bottom: 24px; min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 19px; border-radius: 999px; color: #fff; background: #25d366; box-shadow: 0 12px 28px rgba(17,95,47,0.28); font-size: 0.88rem; font-weight: 800; transition: 0.2s ease; }
.whatsapp-button i { font-size: 1.5rem; }
.whatsapp-button:hover { transform: translateY(-3px); background: #1ebe5a; }

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1120px); }
  .header-nav { display: none; }
  .hero { min-height: 500px; }
  .hero-content { padding-block: 75px; }
  .generator-section { padding: 70px 0; }
  .generator-card { padding: 22px; }
  .fields-grid, .stats-grid, .author-card { grid-template-columns: 1fr; }
  .actions .button { flex: 1 1 140px; }
  .results { margin-top: 55px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 90px; }
  .author-card { max-width: 560px; }
  .author-photo-wrap { max-width: 300px; }
  .footer-content { padding: 24px 0; align-items: flex-start; flex-direction: column; }
  .whatsapp-button { right: 15px; bottom: 15px; width: 54px; padding: 0; justify-content: center; }
  .whatsapp-button span { display: none; }
}

@media (max-width: 430px) {
  .hero h1 { font-size: 2.6rem; }
  .prime-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .prime-number { min-height: 58px; font-size: 0.95rem; }
  .social-links a { flex: 1 1 135px; }
}

@media print {
  @page { size: A4; margin: 16mm; }
  *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
  body { color: #000; background: #fff; font-family: Arial, sans-serif; }
  .no-print, .site-header, .hero, .generator-card, .author-section, .site-footer, .whatsapp-button { display: none !important; }
  main, .generator-section, .container, .results { display: block !important; width: 100%; margin: 0; padding: 0; }
  .results[hidden] { display: none !important; }
  .print-header { display: block; padding-bottom: 10px; border-bottom: 2px solid #26baa5; }
  .print-header h1 { margin: 0; color: #375f7a; font-size: 22pt; }
  .results-heading { margin: 16px 0 10px; align-items: center; }
  .results-heading h2 { display: none; }
  .range-badge { padding: 0; color: #000; background: none; font-size: 11pt; }
  .stats-grid { display: block; margin: 0 0 8px; }
  .stat-card { display: none; }
  .stat-card.stat-featured { min-height: 0; display: block; padding: 0; color: #000; border: 0; background: none; }
  .stat-featured span, .stat-featured strong { display: inline; color: #000; font-size: 11pt; }
  .stat-featured span::after { content: ': '; }
  .print-date { display: block; margin: 5px 0 20px; font-size: 10pt; }
  .prime-grid { grid-template-columns: repeat(8, 1fr); gap: 5px; }
  .prime-number { min-height: 30px; break-inside: avoid; border: 1px solid #aebbc2; border-radius: 3px; color: #000; font-size: 9pt; animation: none; }
  .empty-result { padding: 15px; color: #000; border: 1px solid #aaa; }
}
