* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    padding: 20px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 43, 92, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    border: 1px solid rgba(0, 43, 92, 0.1);
}
.top-header {
    width: 100%;
    background: #ffffff;
    padding: 18px 0;
    text-align: center;
    color: #002b5c;
    font-size: 1.6em;
    font-weight: bold;
    letter-spacing: 0.5px;
    border-bottom: 4px solid #002b5c;
}
.login-wrapper {
    background: #ffffff;
    max-width: 480px;
    width: 100%;
    padding: 28px 24px 22px;
    margin: 20px auto 10px;
    border-radius: 12px;
}
.info-box {
    background: #e7f1ff;
    color: #08396a;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 4px solid #0A3D91;
    margin-bottom: 16px;
    font-size: 0.9em;
}
.error-box {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    margin-bottom: 10px;
    font-size: 0.9em;
}
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    font-size: 0.95em;
    margin-bottom: 14px;
    transition: all 0.2s;
}
input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.btn-primary {
    width: 100%;
    padding: 11px 0;
    border-radius: 8px;
    border: none;
    font-size: 1em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.45);
}
.links {
    margin-top: 16px;
    font-size: 0.9em;
    text-align: center;
}
.links a {
    color: #0A3D91;
    text-decoration: none;
}
.links a:hover { text-decoration: underline; }
.contact-button-container {
    text-align: center;
    padding: 0;
    margin-top: auto;
    width: 100%;
}
.contact-button {
    display: block;
    width: 100%;
    padding: 12px 40px;
    background: transparent;
    color: #002b5c;
    border: 2px solid #002b5c;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
}
.contact-button:hover {
    background: rgba(0, 43, 92, 0.06);
    color: #002b5c;
}
.contact-button.contact-button-disabled,
.contact-button-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
.contact-button.contact-button-disabled:hover,
.contact-button-disabled:hover {
    background: transparent;
    color: #002b5c;
}
.login-contact-only {
    max-width: 480px;
}
.login-contact-only-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 28px 28px;
    text-align: center;
    gap: 28px;
}
.login-bfs-logo {
    display: block;
    width: min(220px, 70%);
    height: auto;
    margin: 0 auto;
}
.login-contact-only-inner .contact-button-container {
    width: 100%;
    max-width: 320px;
    margin: 0;
}
.login-contact-footer {
    width: 100%;
    margin-top: auto;
}
.brn-logo {
    height: 42px;
    vertical-align: middle;
    margin-right: 10px;
}
.brn-logo-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0 10px 0 0;
    cursor: pointer;
    vertical-align: middle;
    line-height: 0;
}
.brn-logo-btn:hover .brn-logo {
    opacity: 0.85;
}
.top-header a {
    text-decoration: none;
    display: inline-block;
}
.top-header a:hover .brn-logo {
    opacity: 0.8;
}
.advantages-box {
    margin-top: 20px;
    padding: 15px;
    border: 2px solid #0047AB;
    border-radius: 6px;
    background: #f8faff;
    color: #003366;
    font-size: 0.95em;
    line-height: 1.4;
}
.advantages-box strong {
    font-size: 1.05em;
    display: block;
    margin-bottom: 6px;
}
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}
.demo-button {
    display: inline-block;
    padding: 15px 40px;
    background: transparent;
    color: #002b5c;
    border: 2px solid #002b5c;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    box-shadow: none;
}
.demo-button:hover {
    background: rgba(0, 43, 92, 0.06);
    transform: none;
    box-shadow: none;
    text-decoration: none;
    color: #002b5c;
}
.admin-link {
    font-size: 0.65em;
    color: #999;
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f5f5f5;
    transition: all 0.2s;
}
.admin-link:hover {
    color: #666;
    background: #e9e9e9;
    border-color: #bbb;
    text-decoration: none;
}

/* Shared content wrapper (login + static pages) */
.page-wrapper {
    background: #ffffff;
    width: 100%;
    max-width: 720px;
    padding: 24px 20px 20px;
    margin: 20px auto 10px;
    border-radius: 12px;
    box-sizing: border-box;
}

/* About / info sections — matches advantages-box */
.about-section {
    margin-top: 0;
    margin-bottom: 16px;
}

.about-section h2 {
    margin: 0 0 10px;
    font-size: 1.15em;
    color: #003366;
    text-align: center;
}

.about-section h3 {
    margin: 1em 0 0.4em;
    font-size: 1em;
    color: #0047AB;
}

.about-section p {
    margin: 0 0 0.65em;
    line-height: 1.5;
}

.about-section ul {
    margin: 0.35em 0 0.75em 1.15em;
    padding: 0;
}

.about-section li {
    margin-bottom: 0.35em;
}

.about-section:first-child {
    margin-top: 0;
}

footer,
.site-footer {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 20px;
    padding-top: 8px;
    width: 100%;
    display: block;
}

.site-footer-text {
    margin: 0 auto;
    padding: 0;
    text-align: center;
    width: 100%;
}

.site-footer-text a {
    color: #0A3D91;
    text-decoration: none;
    font-size: 0.9em;
}

.site-footer-text a:hover {
    text-decoration: underline;
}

footer hr,
.site-footer hr {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 0 auto 10px;
    max-width: 320px;
    width: 80%;
}

.brn-adsense-wrap {
    width: 100%;
    max-width: 728px;
    margin: 20px auto 8px;
    text-align: center;
    overflow: hidden;
    min-height: 90px;
}

.brn-adsense-wrap--compact {
    max-width: 100%;
    margin: 12px 0 0;
    min-height: 60px;
}

/* About page — centred layout */
.about-page {
    text-align: center;
}

.about-page .about-section {
    text-align: left;
}

.about-page .about-section h2,
.about-page .about-section h3 {
    text-align: center;
}

.about-page .about-section ul {
    display: inline-block;
    text-align: left;
    margin-left: 0;
    padding-left: 1.2em;
}

.about-page .button-group,
.about-page .contact-button-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Login form (replaces inline styles) */
.login-form-container h2 {
    text-align: center;
    margin: 0 0 18px;
    font-size: 1.05em;
    line-height: 1.4;
    color: #003366;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.95em;
}

.login-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    margin-bottom: 6px;
}

.form-field input {
    margin-bottom: 0;
    font-size: 16px; /* prevents iOS zoom on focus */
    -webkit-appearance: none;
    appearance: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #002b5c;
    border: 2px solid #002b5c;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    min-height: 48px;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-login:hover {
    background: rgba(0, 43, 92, 0.06);
    color: #002b5c;
}

.admin-link-wrap {
    text-align: center;
    margin-top: 10px;
}

/* ----- Mobile (Android + iPhone) ----- */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .container {
        min-height: calc(100vh - 20px);
        min-height: calc(100dvh - 20px);
        border-radius: 10px;
        max-width: 100%;
    }

    .top-header {
        font-size: 1.1em;
        padding: 14px 10px;
        line-height: 1.35;
    }

    .brn-logo {
        height: 34px;
        margin-right: 6px;
    }

    .login-wrapper,
    .page-wrapper {
        margin: 12px auto 8px;
        padding: 18px 14px 16px;
        border-radius: 10px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .login-form-container h2 {
        font-size: 1em;
    }

    .advantages-box {
        font-size: 0.9em;
        padding: 12px;
    }

    .about-section h2 {
        font-size: 1.05em;
    }

    .contact-button {
        font-size: 0.95em;
        padding: 14px 16px;
        white-space: normal;
        line-height: 1.3;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .contact-button-container {
        width: 100%;
    }

    .button-group {
        gap: 8px;
        width: 100%;
    }

    .login-contact-only-inner {
        padding: 24px 16px 20px;
        gap: 20px;
    }

    .login-bfs-logo {
        width: min(200px, 72vw);
    }

    .login-contact-only-inner .contact-button-container {
        max-width: 100%;
    }

    footer {
        font-size: 0.75rem;
    }
}

@media (max-width: 380px) {
    .top-header {
        font-size: 1em;
    }

    .brn-logo {
        display: block;
        margin: 0 auto 6px;
    }
}
