/* 1. Clean Background for the whole screen */
html, body {
    height: 100%;
}

body {
    margin: 0;
    /* 100dvh is a modern CSS trick specifically for mobile browsers to ignore the URL address bar */
    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e2e8f0;
    font-family: Arial, sans-serif;
    box-sizing: border-box;

    /* This completely disables the outer scrollbar */
    overflow: hidden;

    /* Avoid status bar overlap on mobile */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* 2. Form Container */
.login-container {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)),
        url('photo1/logo.png');

    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-size: 100% 100%, 750px;

    padding: 30px;
    border-radius: 12px;
    border: 1px solid #ccc;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);

    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
}

/* --- Typography & Basic Elements --- */
header h2 {
    color: #b71c1c;
    text-align: center;
    margin: 0;
}

header p {
    text-align: center;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.form-group, .form-row {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.field {
    flex: 1;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    box-sizing: border-box;
}

hr {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid #ddd;
}

.otp-container {
    text-align: center;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.otp-container input {
    width: 120px;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 4px;
    border: 2px solid #b71c1c;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #b71c1c;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.btn-submit:hover {
    background: #8e1616;
}

/* =========================================
   MOBILE RESPONSIVENESS (Screens <= 768px)
   ========================================= */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        overflow-y: auto;
        padding-top: calc(env(safe-area-inset-top) + 8px);
        padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
    }

    .login-container {
        /* Squeeze the outer padding and width to fit the screen */
        padding: 15px 20px;
        width: 95%;
        background-size: 100% 100%, 600px; /* Slightly smaller logo */
        margin: 8px auto;
    }

    header h2 {
        font-size: 1.25rem; /* Slightly smaller header */
    }

    header p {
        margin-bottom: 12px;
    }

    .form-group, .form-row {
        margin-bottom: 8px; /* Squeeze elements together vertically */
    }

    /* Keep First Name and Surname side-by-side to save vertical space! */
    .form-row {
        flex-direction: row;
    }

    input, select {
        padding: 8px; /* Thinner inputs save height */
        font-size: 0.9rem;
    }

    .otp-container {
        padding: 10px;
        margin-bottom: 10px;
    }

    .otp-container input {
        font-size: 1.1rem;
        padding: 8px;
    }

    .btn-submit {
        padding: 10px; /* Thinner button */
    }
}
