
:root {
  --bg: #07111f;
  --panel: #0d1b2a;
  --panel-2: #12263a;
  --text: #edf6ff;
  --muted: #9fb3c8;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --warning: #f59e0b;
  --border: rgba(255,255,255,.10);
  --shadow: 0 18px 45px rgba(0,0,0,.25);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,.14), transparent 32%),
    radial-gradient(circle at top right, rgba(34,197,94,.09), transparent 28%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: inherit; }
header {
  padding: 44px 20px 30px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: rgba(7,17,31,.72);
  backdrop-filter: blur(12px);
}
.eyebrow {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(56,189,248,.35);
  border-radius: 999px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
}
header p {
  max-width: 760px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.02rem;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7,17,31,.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  width: min(1180px, calc(100% - 28px));
  margin: auto;
  padding: 10px 0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.topbar a {
  text-decoration: none;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 10px;
}
.topbar a:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}
main {
  width: min(1180px, calc(100% - 28px));
  margin: 34px auto 60px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 20px;
}
.index-card, .card {
  background: linear-gradient(180deg, rgba(18,38,58,.96), rgba(13,27,42,.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.index-card {
  padding: 22px;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.index-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56,189,248,.55);
}
.index-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.index-card p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: .92rem;
}
.card-header {
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { margin: 0; font-size: 1.35rem; }
.card-header p { margin: 8px 0 0; color: var(--muted); font-size: .93rem; }
.card-body { padding: 22px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field.full { grid-column: 1 / -1; }
label {
  font-size: .88rem;
  color: #c9d8e8;
  font-weight: 650;
}
input, select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(6,15,27,.85);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 1rem;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(56,189,248,.75);
  box-shadow: 0 0 0 3px rgba(56,189,248,.12);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
button, .button-link {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: .92rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}
.primary {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #03121e;
}
.secondary {
  background: rgba(255,255,255,.07);
  color: var(--text);
  border: 1px solid var(--border);
}
.result {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(3,12,22,.74);
  border: 1px solid rgba(56,189,248,.22);
}
.result h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--accent);
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.metric {
  padding: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 4px;
}
.metric strong { font-size: 1.08rem; }
.diagram {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,.18);
  color: #b9d6e8;
  background: rgba(255,255,255,.025);
  font-family: "Courier New", monospace;
  white-space: pre-wrap;
  overflow-x: auto;
  font-size: .88rem;
}
.note {
  margin-top: 14px;
  color: var(--muted);
  font-size: .86rem;
}
.warning {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid rgba(245,158,11,.28);
  background: rgba(245,158,11,.08);
  border-radius: 14px;
  color: #f8deb0;
}
footer {
  text-align: center;
  color: var(--muted);
  padding: 28px 18px 44px;
  font-size: .86rem;
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .card-grid, .form-grid, .result-grid { grid-template-columns: 1fr; }
  .topbar-inner { align-items: flex-start; }
}


/* Dipolo avanzado v0.4 */
.section-title {
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: 1rem;
}
.section-title:first-child { margin-top: 0; }

.inline-help {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
}

.advanced-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 20px;
  align-items: start;
}

.diagram-panel {
  position: sticky;
  top: 78px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(3,12,22,.55);
}

.diagram-panel h3 {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 1rem;
}

.antenna-svg {
  width: 100%;
  min-height: 315px;
  display: block;
  border-radius: 12px;
  background:
    linear-gradient(to bottom, rgba(56,189,248,.06), transparent 68%),
    rgba(4,13,24,.75);
  border: 1px solid rgba(255,255,255,.07);
}

.svg-wire { stroke: #67e8f9; stroke-width: 5; stroke-linecap: round; }
.svg-feed { stroke: #f8fafc; stroke-width: 3; }
.svg-ground { stroke: #8b9caf; stroke-width: 2; stroke-dasharray: 8 7; }
.svg-dimension { stroke: #f59e0b; stroke-width: 1.5; stroke-dasharray: 5 5; }
.svg-support { stroke: #64748b; stroke-width: 2; stroke-dasharray: 4 5; }
.svg-text { fill: #dcecff; font-size: 13px; font-family: system-ui, sans-serif; }
.svg-small { fill: #9fb3c8; font-size: 11px; font-family: system-ui, sans-serif; }
.svg-angle { fill: none; stroke: #22c55e; stroke-width: 2; }

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.status-pill {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: .78rem;
}

.status-pill.good {
  color: #baf7cc;
  border-color: rgba(34,197,94,.3);
  background: rgba(34,197,94,.08);
}

.status-pill.warn {
  color: #f8deb0;
  border-color: rgba(245,158,11,.3);
  background: rgba(245,158,11,.08);
}

.performance-note {
  margin-top: 14px;
  padding: 13px;
  border-radius: 11px;
  border: 1px solid rgba(56,189,248,.18);
  background: rgba(56,189,248,.05);
  color: var(--muted);
  font-size: .84rem;
}

.estimation-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #f8deb0;
  border: 1px solid rgba(245,158,11,.3);
  background: rgba(245,158,11,.08);
  font-size: .7rem;
  vertical-align: middle;
}

.hidden { display: none !important; }

@media (max-width: 900px) {
  .advanced-layout { grid-template-columns: 1fr; }
  .diagram-panel { position: static; }
}

@media (max-width: 540px) {
  .antenna-svg { min-height: 270px; }
}
