body, html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #2471f3; /* Same blue as main page */
    color: #222;
}

/* HEADER STYLING */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 3vw;
    background: #fff;
    box-shadow: 0 2px 12px rgba(50,50,50,0.07);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: .03em;
}

.highlight {
    color: #257cff;
    font-weight: bold;
}

.header nav a {
    padding: .55em 1.4em;
    border-radius: 1.5em;
    border: 1.5px solid #257cff;
    background: transparent;
    color: #257cff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    display: inline-block;
}

.header nav a:hover {
    background: #184c99;
    color: #fff;
    border-color: #184c99;
}

/* REGISTER CONTAINER */
.container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 32px rgba(60,60,60,0.09);
    max-width: 500px; /* Increased from 350px */
    width: 80%; /* Added to ensure responsiveness */
    margin: 60px auto 0 auto;
    padding: 3em 3em; /* Increased padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    margin-bottom: 1.5em;
    color: #257cff;
    letter-spacing: .03em;
    font-size: 1.45em;
    font-weight: 700;
}

.log {
    width: 100%;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.1em;
}

label {
    font-weight: 600;
    margin-bottom: 0.2em;
    color: #222;
}

input[type="text"], input[type="password"] {
    padding: 0.7em 1em;
    border-radius: 8px;
    border: 1.5px solid #257cff;
    outline: none;
    margin-bottom: 0.3em;
    font-size: 1em;
    background: #f5f8ff;
    transition: border-color 0.2s, background 0.2s;
}

input[type="text"]:focus, 
input[type="password"]:focus {
    border-color: #184c99;
    background: #eaf1ff;
}

button[type="submit"] {
    margin-top: 0.5em;
    background: #257cff;
    color: #fff;
    border: 1.5px solid #257cff;
    border-radius: 1.5em;
    padding: 0.8em 0;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    box-shadow: 0 2px 8px rgba(57, 87, 181, 0.08);
}

button[type="submit"]:hover {
    background: #184c99;
    color: #fff;
    border-color: #184c99;
}

.log p {
    margin-top: 1.2em;
    text-align: center;
    font-size: .98em;
    color: #444;
}

.log a {
    color: #257cff;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.log a:hover {
    color: #184c99;
    text-decoration: underline;
}


footer {
    position: relative; /* Change from fixed to relative */
    width: 100%;
    text-align: center;
    padding: 1.5em 0;
    background: #fff;
    color: #272727;
    font-weight: 500;
    font-size: .98em;
    margin-top: 2rem;
    box-shadow: 0 -1px 8px rgba(70,70,70,0.03);
    border-radius: 12px 12px 0 0;
}

footer > p {
    padding: 0;
    margin: 0;
}

@media (max-width: 600px) {
    .container {
        padding: 1.5em 0.6em;
        max-width: 95vw;
    }
    h1 {
        font-size: 1.15em;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: .6em;
        padding: 1em 4vw;
    }
    .brand {
        font-size: 1.1rem;
    }
}

/* =========================== */
/* ENHANCED RESPONSIVE MEDIA QUERIES */
/* =========================== */

/* Mobile Phones (320px - 480px) */
@media screen and (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1rem;
        text-align: center;
    }

    .brand {
        font-size: 1.2rem;
    }

    .header nav a {
        padding: 0.6em 1.2em;
        font-size: 0.9rem;
    }

    .container {
        padding: 2rem 1rem;
        max-width: 95%;
        margin: 20px auto 1rem auto;
        border-radius: 16px;
    }

    h1 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }

    input[type="text"], 
    input[type="password"] {
        padding: 0.8rem 1rem;
        font-size: 1rem;
        border-radius: 10px;
    }

    button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        border-radius: 10px;
        width: 100%;
    }

    .register-link {
        font-size: 0.9rem;
        margin-top: 1rem;
    }

    .register-link a {
        display: inline-block;
        margin-top: 0.5rem;
    }
}

/* Large Mobile / Small Tablet (481px - 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .header {
        padding: 1.2rem 2rem;
    }

    .brand {
        font-size: 1.3rem;
    }

    .container {
        max-width: 90%;
        padding: 2.5rem 2rem;
        margin: 40px auto 2rem auto;
    }

    h1 {
        font-size: 1.4rem;
    }

    input[type="text"], 
    input[type="password"] {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    button {
        padding: 0.8rem 2rem;
        font-size: 1.05rem;
    }
}

/* iPad Portrait & Large Tablets (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .header {
        padding: 1.2rem 3rem;
    }

    .brand {
        font-size: 1.4rem;
    }

    .container {
        max-width: 600px;
        padding: 3rem 3rem;
        margin: 60px auto 2rem auto;
    }

    h1 {
        font-size: 1.5rem;
    }

    input[type="text"], 
    input[type="password"] {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }

    button {
        padding: 0.9rem 2.5rem;
        font-size: 1.1rem;
    }
}

/* iPad Landscape & Desktop (1025px+) */
@media screen and (min-width: 1025px) {
    .container {
        max-width: 500px;
    }

    .header {
        padding: 1.2rem 3vw;
    }
}

/* iPad Specific Adjustments */
@media screen and (min-device-width: 768px) and (max-device-width: 1024px) {
    .container {
        padding: 3rem 3rem;
        border-radius: 20px;
    }

    button {
        min-height: 44px;
        touch-action: manipulation;
    }

    input[type="text"], 
    input[type="password"] {
        min-height: 44px;
        touch-action: manipulation;
    }

    .header nav a {
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* Landscape Orientation for Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .container {
        margin: 10px auto 1rem auto;
        padding: 1.5rem 2rem;
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .log {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }

    input[type="text"], 
    input[type="password"] {
        padding: 0.6rem 0.8rem;
    }

    button {
        padding: 0.6rem 1.5rem;
    }

    .header {
        padding: 0.8rem 2rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    button,
    input[type="text"],
    input[type="password"],
    .header nav a {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }

    button:active {
        transform: scale(0.98);
    }

    .header nav a:active {
        transform: scale(0.95);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .container {
        border: 0.5px solid rgba(0,0,0,0.1);
    }
    
    h1 {
        text-rendering: optimizeLegibility;
    }
}

/* Dark Mode Support - Disabled for consistent blue theme */
@media (prefers-color-scheme: dark) {
    body, html {
        background: #2471f3; /* Keep blue background even in dark mode */
    }

    .header {
        background: #ffffff; /* Keep white header */
        color: #222;
    }

    .container {
        background: #ffffff; /* Keep white container */
        color: #222;
    }

    input[type="text"], 
    input[type="password"] {
        background: #f5f8ff; /* Light blue background */
        border-color: #d0e7ff;
        color: #222;
    }

    input[type="text"]:focus, 
    input[type="password"]:focus {
        border-color: #257cff;
        background: #eaf1ff;
    }

    label {
        color: #222; /* Dark text for labels */
    }

    .register-link {
        color: #222;
    }

    .register-link a {
        color: #257cff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    button,
    .header nav a {
        transition: none;
    }

    button:active,
    .header nav a:active {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    button {
        border: 2px solid #000000;
    }

    input[type="text"], 
    input[type="password"] {
        border: 2px solid #000000;
    }

    .container {
        border: 2px solid #000000;
    }

    h1 {
        font-weight: 700;
    }
}