/* euaicon.com — institucional europeo. Sin frameworks, sin fuentes externas, sin cookies. */

:root {
  --eu-blue: #003399;
  --eu-blue-dark: #002266;
  --eu-blue-soft: #dbe4f5;
  --gold: #FFCC00;
  --gold-dark: #b8930a;
  --ink: #1c2333;
  --ink-soft: #46506a;
  --paper: #fdfcf8;
  --paper-alt: #f4f2ea;
  --line: #e3e0d4;
  --serif: Georgia, 'Times New Roman', Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--eu-blue-dark);
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.15rem; }

a { color: var(--eu-blue); }
a:hover { color: var(--eu-blue-dark); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container.narrow { max-width: 46rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--eu-blue);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus-visible { left: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(253, 252, 248, 0.95);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

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

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--eu-blue);
}

.site-nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 0.2rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--eu-blue);
  border-bottom-color: var(--gold);
}

.lang-select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

/* Hero */
.hero {
  background:
    radial-gradient(60rem 30rem at 80% -10%, var(--eu-blue-soft), transparent 60%),
    var(--paper);
  padding: 5.5rem 0 0;
  text-align: center;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.82rem;
  color: var(--gold-dark);
  margin: 0 0 0.8rem;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  letter-spacing: 0.08em;
  color: var(--eu-blue);
  margin: 0 0 0.5rem;
}

.hero-claim {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 38rem;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

/* Banda mediterránea sobria: mar → cal */
.sea-band {
  height: 0.9rem;
  background: linear-gradient(90deg, var(--eu-blue-dark), var(--eu-blue) 35%, #4d79c9 65%, #f7f5ec);
}

/* Buttons */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  border: 2px solid var(--eu-blue);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--eu-blue);
  color: #fff;
}
.btn-primary:hover { background: var(--eu-blue-dark); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--eu-blue);
}
.btn-secondary:hover { background: var(--eu-blue-soft); }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--paper-alt); }

.section-gold {
  background: linear-gradient(135deg, var(--eu-blue) 0%, var(--eu-blue-dark) 100%);
}
.section-gold h2 { color: var(--gold); }
.section-gold .lead { color: #f0f3fa; }

.lead { font-size: 1.08rem; color: var(--ink-soft); }

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--gold-dark);
  margin: 0 0 0.4rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  padding: 1.3rem 1.4rem;
}

.card p { margin-bottom: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Form */
.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--eu-blue);
}

/* Honeypot: fuera de pantalla, no display:none (algunos bots lo detectan) */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status { min-height: 1.5em; margin-top: 0.8rem; font-weight: 600; }
.form-status.ok { color: #1d6b32; }
.form-status.err { color: #a5222a; }

/* Contact */
.contact-block { font-style: normal; }
.contact-block p { margin: 0.25rem 0; }

/* Footer */
.site-footer {
  background: var(--eu-blue-dark);
  color: #d9e0f2;
  padding: 2.5rem 0;
  font-size: 0.9rem;
  text-align: center;
}

.site-footer a { color: var(--gold); }

.site-footer .disclaimer {
  max-width: 44rem;
  margin: 1rem auto;
  color: #aab6d8;
  font-size: 0.82rem;
}

/* Chat widget */
.chat-widget {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 60;
}

.chat-toggle {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  border: none;
  background: var(--eu-blue);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 34, 102, 0.35);
}
.chat-toggle:hover { background: var(--eu-blue-dark); }

.chat-panel {
  position: fixed;
  right: 1.1rem;
  bottom: 5.2rem;
  width: min(22rem, calc(100vw - 2.2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 34, 102, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel[hidden] { display: none; }

.chat-header {
  background: var(--eu-blue);
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.chat-messages {
  padding: 0.8rem;
  height: 16rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.92rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--eu-blue);
  color: #fff;
}

.chat-msg.bot {
  align-self: flex-start;
  background: var(--paper-alt);
  color: var(--ink);
}

.chat-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  border-top: 1px solid var(--line);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chat-form .btn { padding: 0.5rem 0.9rem; }

/* Oscurecimiento suave sin toggle */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10141f;
    --paper-alt: #171c2b;
    --line: #2b3247;
    --ink: #e8eaf2;
    --ink-soft: #aab2c8;
    --eu-blue-soft: #1c2f56;
  }
  body { background: var(--paper); }
  h1, h2, h3 { color: #cdd9f5; }
  a { color: #8fb0ef; }
  a:hover { color: #b4cbf7; }
  .site-header { background: rgba(16, 20, 31, 0.95); }
  .hero-title { color: #9db9f0; }
  .card, .lang-select, .field input, .field textarea, .chat-panel, .chat-form input {
    background: #1b2133;
    color: var(--ink);
  }
  .btn-secondary { color: #9db9f0; border-color: #9db9f0; }
  .btn-secondary:hover { background: #1c2f56; }
  .chat-msg.bot { background: #232b40; color: var(--ink); }
  .sea-band { background: linear-gradient(90deg, #001a4d, var(--eu-blue) 35%, #33528f 65%, #171c2b); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 40rem) {
  .site-nav { gap: 0.6rem; font-size: 0.85rem; }
  .section { padding: 2.8rem 0; }
  .hero { padding-top: 3.5rem; }
}
