@font-face {
    font-family: 'Lato';
    src: url('/fonts/Lato-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Lato';
    src: url('/fonts/Lato-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lato';
    src: url('/fonts/Lato-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

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

body {
    font-family: 'Lato', Arial, sans-serif;
    background-color:rgb(245, 247, 247);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-container {
    width: 80%;
    max-width: 1200px;
    padding-top: 80px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    background-color: white;
    padding: 2rem 8rem;
    border-radius: 8px;
    text-align: left;
    width: 100%;
}

h1 {
    margin-bottom: 2rem;
    color: #333;
}

.region-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    font-weight: 300;
}

.disclaimer {
    margin: 0 0 2rem;
    padding: 12px 16px;
    background: #f5f9ff;
    border: 1px solid #d6e6ff;
    border-left: 4px solid rgb(72, 130, 172);
    border-radius: 6px;
    color: #35536a;
    font-size: 0.95rem;
    line-height: 1.5;
    display: none; /* hidden by default */
}

.disclaimer.is-visible {
    display: block;
}

.disclaimer::before {
    content: "ℹ️";
    display: inline-block;
    margin-right: 8px;
}

html[dir='rtl'] .disclaimer {
    border-left-width: 1px;
    border-right: 4px solid rgb(72, 130, 172);
}

html[dir='rtl'] .disclaimer::before {
    margin-right: 0;
    margin-left: 8px;
}

.region-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.region-btn {
    padding: 1rem;
    border: solid;
    border-color: #dce1e8;
    border-width: 1px;
    border-radius: 8px;
    background-color: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.region-btn:hover {
    border-color: #a0b3b3;
}

/* Better keyboard focus for accessibility */
.region-btn:focus-visible {
    outline: 3px solid rgba(72, 130, 172, 0.45);
    outline-offset: 2px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(72, 130, 172, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(72, 130, 172, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(72, 130, 172, 0);
    }
}

.region-btn.suggested {
    border-color: rgb(72, 130, 172);
    background-color: rgba(72, 130, 172, 0.05);
    animation: pulse 2s infinite;
}

.region-emoji {
    font-size: 2.4rem;
    line-height: 1;
}

.region-btn .region-text {
    font-size: 16px;
    font-weight: 300;
}

.region-btn .suggested-message {
    margin-top: 0;
}

.region-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
}

.region-btn-wrapper .suggested-message {
    margin-top: 12px;
    width: 100%;
    color: rgb(72, 130, 172);
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

@media (min-width: 480px) {
    .region-options {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
    
    .region-btn {
        min-width: 180px;
    }
}

.logo {
    margin-bottom: 16px;
    width: 200px;
    height: auto;
    align-self: flex-start;
}

.logo svg {
    width: auto;
    height: 75px;
}

.logo svg path {
    fill: rgb(38, 68, 106);
}

.logo a {
    display: block;
    width: 100%;
    height: 100%;
}

.lang-switcher {
    align-self: flex-end;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switcher label {
    color: #333;
    font-size: 14px;
}

.lang-switcher select {
    padding: 6px 8px;
    border: 1px solid #dce1e8;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
}

.footer {
    width: 80%;
    max-width: 1200px;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    color: rgb(72, 130, 172);
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 300;
    line-height: 16.9px;
    margin: 0;
    padding: 0;
    text-align: center;
}

.hidden {
    display: none;
}

/* ------------------------------ */
/* Responsive adjustments         */
/* ------------------------------ */

/* Phones */
@media (max-width: 480px) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .main-container {
        width: 92%;
        padding-top: 40px;
        align-items: stretch;
    }

    .logo {
        width: 180px;
        align-self: flex-start;
        margin-bottom: 12px;
    }

    .logo svg {
        height: 60px;
    }

    .lang-switcher {
        align-self: flex-end;
        margin-bottom: 16px;
        gap: 6px;
    }

    .lang-switcher label {
        font-size: 13px;
        display: none; /* hide label on small screens; select has aria-label */
    }

    .lang-switcher select {
        font-size: 13px;
        padding: 6px 8px;
    }

    .container {
        padding: 1rem 1.25rem;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.5rem;
        line-height: 1.2;
        margin-bottom: 1.25rem;
    }

    .region-description {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }

    .region-options {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        align-items: stretch;
    }

    .region-btn {
        padding: 0.875rem;
        min-height: 56px;
        width: 100%;
        flex-direction: row;
        gap: 12px;
    }

    .region-emoji {
        font-size: 1.75rem;
    }

    .disclaimer {
        font-size: 0.9rem;
        padding: 10px 12px;
        word-break: break-word;
        overflow-wrap: anywhere;
        border-radius: 8px;
    }

    .footer {
        width: 92%;
        padding: 1.25rem 0;
    }

    .footer p {
        font-size: 12px;
        line-height: 1.3;
    }
}

/* Small tablets / large phones in landscape */
@media (min-width: 481px) and (max-width: 900px) {
    .main-container {
        width: 90%;
        padding-top: 56px;
    }

    .container {
        padding: 1.5rem 2.5rem;
    }

    .region-options {
        gap: 1.25rem;
        justify-content: center;
    }

    .region-btn {
        min-width: 0;
        flex: 1;
    }

    .footer {
        width: 90%;
    }
}

/* Landscape on mobile/small tablets: reduce logo footprint */
@media (max-width: 900px) and (orientation: landscape) {
    .main-container {
        padding-top: 24px;
    }

    .logo {
        width: 120px;
        margin-bottom: 8px;
    }

    .logo svg {
        height: 48px;
    }
}
