:root {
    --brand-primary: #106b4f;
    --brand-secondary: #9f2241;
    --ink: #12241f;
    --muted: #53625d;
    --line: #d8e4df;
    --soft: #eef5f2;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.container {
    width: min(100% - 32px, 1180px);
    margin-inline: auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.btn-lg {
    min-height: 54px;
}

.btn-brand {
    color: #fff;
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.form-control {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cbdad4;
    border-radius: 6px;
    font: inherit;
}

.form-control:focus {
    outline: 3px solid rgba(16, 107, 79, .18);
    border-color: var(--brand-primary);
}

.directory-shell {
    min-height: calc(100vh - 78px);
    padding: clamp(18px, 4vw, 48px) 0 clamp(32px, 6vw, 68px);
    background: linear-gradient(180deg, #f8fcfa 0%, #fff 82%);
}

.directory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    gap: clamp(18px, 4vw, 46px);
    align-items: end;
    padding-bottom: clamp(22px, 4vw, 42px);
    border-bottom: 1px solid var(--line);
}

.directory-brand {
    grid-column: 1 / -1;
    width: fit-content;
    display: inline-flex;
    align-items: baseline;
    color: #083d2f;
    font-size: clamp(1.55rem, 7vw, 3rem);
    font-weight: 850;
    letter-spacing: 0;
}

.directory-brand strong {
    color: var(--brand-secondary);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--brand-secondary);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
}

.directory-copy h1 {
    max-width: 800px;
    margin: 0 0 14px;
    color: var(--ink);
    font-size: clamp(1.8rem, 9vw, 4.6rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.directory-copy p:not(.eyebrow) {
    max-width: 620px;
    color: var(--muted);
    font-size: clamp(1rem, 3vw, 1.22rem);
    line-height: 1.45;
    margin: 0;
}

.directory-tools {
    display: grid;
    gap: 10px;
    align-self: stretch;
    align-content: end;
}

.country-search .form-control {
    box-shadow: 0 8px 20px rgba(18, 36, 31, .06);
}

.directory-grid {
    margin-top: clamp(20px, 4vw, 40px);
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.country-card {
    min-height: 174px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(18, 36, 31, .055);
    padding: 20px;
    background: #fff;
}

.country-card:focus-visible {
    outline: 3px solid rgba(159, 34, 65, .22);
}

.country-card strong {
    color: #083d2f;
    font-size: 1.25rem;
}

.country-card span:last-child {
    color: var(--brand-secondary);
    font-size: .98rem;
    font-weight: 800;
}

.country-flag {
    font-size: 3rem;
    line-height: 1;
}

.country-empty {
    margin: 24px 0 0;
    color: var(--muted);
    text-align: center;
}

.site-footer {
    padding: 24px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: #fff;
    font-size: .95rem;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 767px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .directory-shell {
        padding-top: 14px;
    }

    .directory-hero {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .country-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .country-card {
        min-height: 132px;
        padding: 16px;
    }

    .site-footer .container {
        flex-direction: column;
    }
}

@media (min-width: 768px) and (max-width: 1100px) {
    .country-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
