/* =============================================
   TRIBUNAL DE SERVICIO CIVIL — REPUBLIC OF EL SALVADOR
   Institutional Web Design
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Sans+3:wght@300;400;600&display=swap');

:root {
  --navy:       #1a2744;
  --navy-light: #253461;
  --gold:       #c8a84b;
  --gold-light: #e0c06a;
  --cream:      #f7f4ef;
  --white:      #ffffff;
  --gray:       #5a5f6e;
  --gray-light: #e8e5e0;
  --red-sv:     #0f47af;
  --text:       #2c2c2c;
  --shadow:     0 4px 24px rgba(26,39,68,.12);
  --shadow-lg:  0 12px 48px rgba(26,39,68,.18);
  --radius:     6px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ── NAVBAR ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  transition: box-shadow var(--transition);
}
#navbar.scrolled { box-shadow: var(--shadow-lg); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 72px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.nav-brand img {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
}
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.nav-brand-text .institution { font-family: 'Playfair Display', serif; font-size: .88rem; color: var(--gold); letter-spacing: .04em; }
.nav-brand-text .dependency  { font-size: .72rem; color: rgba(255,255,255,.65); letter-spacing: .03em; }

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  height: 100%;
}
.nav-links a {
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0 1.2rem;
  text-decoration: none;
  color: rgba(255,255,255,.82);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  position: relative;
  transition: color var(--transition);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 1.2rem; right: 1.2rem;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: var(--transition);
  display: block;
}

/* ── HERO ── */
#inicio {
  min-height: 100vh;
  background: var(--navy);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 70% 50%, rgba(200,168,75,.08) 0%, transparent 70%),
    linear-gradient(145deg, var(--navy) 0%, #0d1a36 100%);
}
.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 30px,
    rgba(200,168,75,.03) 30px,
    rgba(200,168,75,.03) 31px
  );
}
.hero-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding-top: 72px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(200,168,75,.12);
  border: 1px solid rgba(200,168,75,.3);
  border-radius: 2px;
  padding: 6px 14px;
  color: var(--gold);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-badge::before { content: ''; width: 6px; height: 6px; background: var(--gold); border-radius: 50%; }

.hero-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-text h1 span { color: var(--gold); display: block; }
.hero-text p {
  color: rgba(255,255,255,.65);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 480px;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,168,75,.35); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(200,168,75,.5);
  color: var(--gold);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: var(--radius);
  transition: var(--transition);
  background: transparent;
  cursor: pointer;
}
.btn-outline:hover { border-color: var(--gold); background: rgba(200,168,75,.08); }

.hero-emblem {
  display: flex;
  justify-content: center;
  align-items: center;
}
.emblem-ring {
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(200,168,75,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: rotateSlow 60s linear infinite;
}
.emblem-ring::before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(200,168,75,.1);
}
.emblem-inner {
  width: 300px;
  height: 300px;
  background: var(--white);
  border-radius: 50%;
  border: 2px solid rgba(200,168,75,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotateSlow 60s linear infinite reverse;
}
.emblem-inner img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  display: block;
  border-radius: 50%;
}
@keyframes rotateSlow { to { transform: rotate(360deg); } }

/* ── SECTION COMMONS ── */
section { padding: 90px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

.section-tag {
  display: inline-block;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.section-line {
  width: 56px; height: 3px;
  background: var(--gold);
  margin-bottom: 1.5rem;
}
.section-lead {
  font-size: 1.05rem;
  color: var(--gray);
  max-width: 640px;
  line-height: 1.75;
}

/* ── QUIÉNES SOMOS ── */
#quienes {
  background: var(--cream);
}
.quienes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
.quienes-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}
.q-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 3px solid var(--gold);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.q-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.q-card .icon { font-size: 1.5rem; margin-bottom: .75rem; }
.q-card h4 { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--navy); margin-bottom: .5rem; font-weight: 600; }
.q-card p  { font-size: .875rem; color: var(--gray); line-height: 1.6; }

.quienes-visual {
  position: relative;
}
.visual-card {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 2.5rem;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.visual-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: rgba(200,168,75,.08);
  border-radius: 50%;
}
.visual-card .vc-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: .5rem; }
.visual-card h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin-bottom: 1rem; }
.visual-card p { font-size: .9rem; color: rgba(255,255,255,.7); line-height: 1.7; }
.visual-divider { height: 1px; background: rgba(200,168,75,.2); margin: 1.25rem 0; }
.stat-row { display: flex; gap: 2rem; margin-top: 1.5rem; }
.stat { }
.stat .num { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--gold); font-weight: 700; }
.stat .lbl { font-size: .75rem; color: rgba(255,255,255,.55); margin-top: 2px; }

/* ── CONTACT ── */
#contacto {
  background: var(--white);
}
.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 4rem;
  align-items: start;
}
.contact-info { }
.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.contact-icon {
  width: 48px; height: 48px;
  background: var(--navy);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.contact-item h4 { font-weight: 700; color: var(--navy); margin-bottom: .25rem; font-size: .9rem; }
.contact-item p, .contact-item a { font-size: .9rem; color: var(--gray); text-decoration: none; }
.contact-item a:hover { color: var(--gold); }

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--navy);
  aspect-ratio: 4/3;
}
.map-wrap iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

.contact-form-area {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
}
.contact-form-area h4 { font-family: 'Playfair Display', serif; color: var(--navy); margin-bottom: 1.25rem; font-size: 1.1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: .4rem; letter-spacing: .04em; text-transform: uppercase; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--gold); }
.form-group textarea { resize: vertical; min-height: 110px; }

/* ── FOOTER ── */
footer {
  background: var(--navy);
  border-top: 3px solid var(--gold);
  padding: 2.5rem 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 38px; filter: brightness(0) invert(1); opacity: .7; }
.footer-brand span { font-size: .8rem; color: rgba(255,255,255,.5); }
.footer-copy { font-size: .78rem; color: rgba(255,255,255,.45); text-align: center; }
.footer-sv { font-size: .78rem; color: var(--gold); opacity: .7; }

/* ── FADE-IN ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 100px; }
  .hero-emblem { display: none; }
  .quienes-grid, .contacto-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .quienes-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: var(--navy); border-top: 1px solid rgba(200,168,75,.2); padding: 1rem 0; }
  .nav-links.open { display: flex; }
  .nav-links a { height: auto; padding: .85rem 2rem; }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  section { padding: 60px 0; }
}
