/* Tablet Responsive Styles */
@media screen and (max-width: 768px) and (min-width: 481px) {
    body {
        padding: 140px 1rem 40px 1rem; /* Better centering for tablets */
    }

    .container {
        margin: 0 auto;
    }

    .decorative-images {
        top: -110px;
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 480px) {
    body {
        padding: 120px 0 20px 0; /* Add top padding for decorative images */
        min-height: 100vh;
        min-height: -webkit-fill-available; /* Better mobile support */
    }

    .container {
        padding: 1.5rem;
        margin: 0 1rem;
        width: auto;
        /* Ensure container fits within viewport */
        max-width: calc(100vw - 2rem);
    }

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

    input {
        padding: 0.875rem;
        font-size: 16px; /* Prevent iOS zoom */
    }

    button,
    .register-button {
        padding: 0.875rem;
        font-size: 1rem;
    }

    .form-group {
        margin-bottom: 0.875rem;
    }

    .switch-form {
        margin-top: 0.875rem;
    }

    .decorative-images {
        width: 286px;
        top: -100px; /* Slightly reduced to prevent cutting off */
    }
    .left-image,
    .right-image {
        width: 143px;
        height: 114px;
    }
}

/* Ensure minimum touch target size */
@media (hover: none) and (pointer: coarse) {

    button,
    .register-button,
    input,
    .switch-form a {
        min-height: 44px;
    }
}

/* Mobile adjustments for OAuth */
@media screen and (max-width: 480px) {
    .oauth-section {
        margin-top: 0.75rem;
    }

    .google-signin-btn,
    .facebook-signin-btn {
        font-size: 14px;
        padding: 10px 20px;
    }

    .google-icon,
    .facebook-icon {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .divider span {
        font-size: 13px;
        padding: 0 12px;
    }

    .register-link {
        margin-top: 0.5rem;
    }

    .forgot-password-link {
        margin-top: 0.5rem;
    }
}

/* Ensure OAuth buttons meet touch target size */
@media (hover: none) and (pointer: coarse) {
    .google-signin-btn,
    .facebook-signin-btn {
        min-height: 44px;
    }
}

/* Very small screens - Extra adjustments */
@media screen and (max-height: 640px) {
    body {
        padding: 80px 0 20px 0; /* Reduce top padding on short screens */
    }

    .container {
        padding: 1rem;
    }

    .decorative-images {
        top: -90px; /* Move decorative images closer */
        width: 250px;
    }

    .left-image,
    .right-image {
        width: 120px;
        height: 96px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    input, button, .register-button {
        padding: 0.7rem;
    }
}

/* Landscape orientation on mobile */
@media screen and (max-width: 896px) and (max-height: 480px) and (orientation: landscape) {
    body {
        padding: 60px 1rem 20px 1rem;
        align-items: flex-start; /* Don't center vertically in landscape */
    }

    .container {
        margin: 0 auto;
    }

    .decorative-images {
        top: -80px;
        width: 220px;
    }

    .left-image,
    .right-image {
        width: 100px;
        height: 80px;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    input, button, .register-button {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .oauth-section {
        margin-top: 0.75rem;
    }

    .divider {
        margin: 0.5rem 0;
    }

    .register-link {
        margin-top: 0.5rem;
    }

    .forgot-password-link {
        margin-top: 0.5rem;
    }
}
