/* ── Variables ────────────────────────────────────────────────────── */
:root {
    --primary:      #2176AE;
    --primary-dark: #1a5f8a;
    --text:         #222;
    --text-light:   #666;
    --border:       #e0e0e0;
    --bg-light:     #f5f7fa;
    --footer-bg:    #1e2b38;
    --green:        #34c759;
    --max-width:    1100px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    line-height: 1.65;
    background: #fff;
}

/* ── Header / Nav ─────────────────────────────────────────────────── */
header {
    background: rgba(255,255,255,0.97);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 24px;
}

/* Logo */
.logo { text-decoration: none; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img { height: 40px; width: auto; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 1.15rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.logo-tagline { font-size: 10px; color: var(--text-light); letter-spacing: 0.03em; }

/* Nav */
nav ul { display: flex; list-style: none; gap: 1px; align-items: center; flex-wrap: nowrap; }
nav a {
    text-decoration: none;
    color: #4a5568;
    font-size: 13.5px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
nav a:hover { background: var(--bg-light); color: var(--primary); }
nav a.active { color: var(--primary); font-weight: 600; }

.btn-login {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 600 !important;
    margin-left: 8px;
}
.btn-login:hover { background: var(--primary-dark) !important; color: #fff !important; }

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.2s; }

/* ── Main layout ──────────────────────────────────────────────────── */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* ── Page title ───────────────────────────────────────────────────── */
.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}
.page-subtitle {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 36px;
}

/* ── Hero section (homepage) ──────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1a5f8a 100%);
    color: #fff;
    padding: 48px 32px;
    border-radius: 14px;
    margin-bottom: 48px;
}
.hero-title { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.hero-text { font-size: 15px; opacity: 0.9; max-width: 680px; line-height: 1.7; }

/* ── Stats ────────────────────────────────────────────────────────── */
.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 48px;
}
.stat-card {
    flex: 1;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    border-top: 4px solid var(--primary);
}
.stat-number { font-size: 2.2rem; font-weight: 700; color: var(--primary); display: block; }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* ── Intro text ───────────────────────────────────────────────────── */
.intro-box {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 48px;
    border-left: 4px solid var(--primary);
}
.intro-box p { color: var(--text-light); margin-bottom: 10px; }
.intro-box p:last-child { margin-bottom: 0; }

/* ── Section heading ──────────────────────────────────────────────── */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

/* ── News ─────────────────────────────────────────────────────────── */
.news-list {}
.news-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-date { font-size: 12px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.news-title { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.news-body { font-size: 14px; color: var(--text-light); line-height: 1.6; }
.news-images { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.news-images img {
    max-width: 180px;
    max-height: 130px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}

/* ── Person cards (Organs) ────────────────────────────────────────── */
.organ-group { margin-bottom: 36px; }
.organ-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}
.person-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.person-card:last-child { border-bottom: none; }
.person-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.person-info {}
.person-name { font-weight: 600; font-size: 0.95rem; }
.person-role { color: var(--text-light); font-size: 13px; margin-top: 2px; }
.person-tel { color: var(--primary); font-size: 13px; margin-top: 4px; text-decoration: none; }
.person-tel:hover { text-decoration: underline; }

/* ── Contact forms ────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-bottom: 40px; }
.contact-section { background: var(--bg-light); border-radius: 10px; padding: 24px; }
.contact-section h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.contact-section .contact-role { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 80px; resize: vertical; }
.btn-submit {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-submit:hover { background: var(--primary-dark); }

/* ── Tables ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #f0f5fa; }

/* ── Quality badges ───────────────────────────────────────────────── */
.badge-ok {
    display: inline-block;
    background: var(--green);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Quality network cards ────────────────────────────────────────── */
.quality-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.quality-card { background: var(--bg-light); border-radius: 10px; padding: 20px; border-top: 3px solid var(--primary); }
.quality-card h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.quality-date { font-size: 11px; color: var(--text-light); margin-bottom: 12px; }
.quality-values { font-size: 13px; color: var(--text-light); }
.quality-values tr td:first-child { font-weight: 600; color: var(--text); padding: 3px 12px 3px 0; border: none; }
.quality-values tr td { padding: 3px 12px 3px 0; border: none; }
.quality-status { margin-top: 12px; }

/* ── Infra cards ──────────────────────────────────────────────────── */
.infra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.infra-card {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 24px;
    border-left: 4px solid var(--primary);
}
.infra-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.infra-card p { font-size: 14px; color: var(--text-light); margin-bottom: 8px; line-height: 1.6; }
.infra-card p:last-child { margin-bottom: 0; }
.infra-tag {
    display: inline-block;
    background: #e8f2f9;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 6px;
}

/* ── Historia timeline ────────────────────────────────────────────── */
.historia-section { margin-bottom: 40px; }
.historia-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.historia-section p { font-size: 14px; color: var(--text-light); margin-bottom: 10px; line-height: 1.65; }
.historia-section ul { margin: 8px 0 12px 20px; }
.historia-section li { font-size: 14px; color: var(--text-light); margin-bottom: 4px; }
.historia-section li strong { color: var(--primary); }

/* ── Projects table ───────────────────────────────────────────────── */
.projects-table th, .projects-table td { padding: 12px 16px; }

/* ── Downloads ────────────────────────────────────────────────────── */
.download-group { margin-bottom: 36px; }
.download-group-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
.download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    transition: color 0.15s;
}
.download-item:last-child { border-bottom: none; }
.download-item:hover { color: var(--primary); }
.download-icon { font-size: 20px; flex-shrink: 0; }
.download-name { flex: 1; }
.download-size { font-size: 12px; color: var(--text-light); flex-shrink: 0; }

/* ── Ovras electricas table ───────────────────────────────────────── */
.ovras-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ovras-card { background: var(--bg-light); border-radius: 10px; padding: 24px; border-top: 3px solid var(--primary); }
.ovras-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.ovras-card table { font-size: 13px; }
.ovras-card td:first-child { font-weight: 600; color: var(--text); width: 55%; }
.ovras-card td { border-bottom: 1px solid var(--border); padding: 8px 12px; }

/* ── Impressum ────────────────────────────────────────────────────── */
.impressum-box { max-width: 600px; }
.impressum-box p { font-size: 15px; color: var(--text-light); margin-bottom: 12px; line-height: 1.7; }

/* ── Footer ───────────────────────────────────────────────────────── */
footer {
    background: var(--footer-bg);
    color: #aaa;
    padding: 36px 24px;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-contact { font-size: 14px; line-height: 1.9; }
.footer-contact a { color: #aaa; text-decoration: none; }
.footer-contact a:hover { color: #fff; }
.footer-links { font-size: 13px; }
.footer-links a { color: #aaa; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 12px; margin-top: 8px; color: #666; }

/* ── Login Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px;
    width: 380px;
    max-width: 100%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    position: relative;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.modal-logo { color: var(--primary); font-size: 28px; margin-bottom: 12px; }
.modal h2 { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }

.modal .form-group { margin-bottom: 16px; }
.modal .form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.modal .form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    background: #fafafa;
}
.modal .form-group input:focus { border-color: var(--primary); background: #fff; }

.btn-modal-login {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s;
    letter-spacing: 0.01em;
}
.btn-modal-login:hover { background: var(--primary-dark); }
.btn-modal-login:disabled { opacity: 0.6; cursor: default; }

.modal-error {
    color: #ff3b30;
    font-size: 13px;
    margin-top: 10px;
    display: none;
    padding: 8px 12px;
    background: #fff0ef;
    border-radius: 6px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 4px;
}
.modal-close:hover { color: var(--text); }

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .contact-grid { grid-template-columns: 1fr; }
    .quality-grid { grid-template-columns: 1fr; }
    .infra-grid { grid-template-columns: 1fr; }
    .ovras-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    nav {
        display: none;
        position: absolute;
        top: 66px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    nav.open { display: block; }
    nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
    nav a { display: block; padding: 10px 12px; }
    .btn-login { margin-left: 0; text-align: center; }
    header { position: relative; }
    .stats { flex-direction: column; }
    .hero { padding: 32px 20px; }
    .hero-title { font-size: 1.5rem; }
    main { padding: 24px 16px 40px; }
}
