/* Wersja ostateczna - maksymalna kompatybilność, bez Flexboxa dla głównego layoutu */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    /* Usunięto overflow: hidden; aby umożliwić przewijanie w razie potrzeby */
}

/* === GŁÓWNA ZMIANA: REZYGNACJA Z FLEXBOX === */
#app-container {
    width: 100%;
    padding: 40px 20px 20px 20px; /* Odstęp od góry i po bokach */
    box-sizing: border-box;
    /* Usunięto display:flex, height:100vh i inne właściwości flexboxa */
}

/* Zapewnienie centrowania klasyczną metodą margin:auto */
#logo-container, .button-wrapper {
    margin-left: auto;
    margin-right: auto;
}


#logo-container {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
}

#logo {
    height: 55px;
    width: auto;
}

#address-container {
    margin-top: 15px;
}

#address {
    font-size: 0.9em;
    color: black;
    font-weight: bold;
    line-height: 1.4;
    margin: 0;
}

#directions-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9em;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

#directions-link:hover {
    text-decoration: underline;
}


/* --- Ekran logowania --- */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex; /* Flexbox jest tu bezpieczny, bo to prosty overlay */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    z-index: 1000;
}

#login-box {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 320px;
}

#login-box h1 { margin-top: 0; font-size: 1.5em; color: #333; }
#password-input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; font-size: 1.1em; text-align: center; }
#password-form button { width: 100%; padding: 12px; background-color: #007bff; color: #fff; border: none; border-radius: 8px; font-size: 1.1em; cursor: pointer; transition: background-color 0.2s; }
#password-form button:hover { background-color: #0056b3; }
#error-message { color: #dc3545; min-height: 20px; margin-top: 10px; font-weight: bold; }


/* --- Przyciski i opisy --- */
.button-wrapper {
    width: 100%;
    max-width: 350px;
    text-align: center;
    margin-bottom: 25px;
}

.gate-button {
    width: 100%;
    height: 120px;
    font-size: 2em;
    font-weight: bold;
    color: #fff;
    background-color: #333;
    border: 3px solid #333;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.gate-button:active {
    background-color: #007bff;
    transform: scale(0.97);
}

.gate-description {
    font-size: 1rem;
    color: #666;
    margin-top: 8px;
    margin-bottom: 0;
    font-weight: normal;
}

.feedback {
    display: block;
    margin-top: 10px;
    min-height: 22px;
    font-size: 1em;
    font-weight: bold;
    color: #28a745;
}

.hidden {
    display: none !important;
}