﻿/* ===== LOGIN SCREEN ===== */
.submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.login-container {
    position: fixed; /* Changed from relative to fixed */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem;
    font-family: 'Segoe UI', sans-serif;
    overflow: auto; /* Changed from hidden to auto to allow scrolling if needed */
    z-index: 1;
    backface-visibility: hidden; /* Prevent rendering artifacts */
    transform: translateZ(0); /* Hardware acceleration */
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 1s ease-in-out;
    will-change: opacity;
    backface-visibility: hidden;
    transform: translateZ(0); /* Hardware acceleration */
    image-rendering: -webkit-optimize-contrast; /* Smooth transitions */
}

    .bg-layer.active {
        opacity: 1;
        z-index: 0;
    }

    .bg-layer.inactive {
        opacity: 0;
        z-index: 0;
        pointer-events: none; /* Prevent interaction */
    }

/* Prevent flickering */
.bg-layer {
    backface-visibility: hidden;
    transform: translate3d(0,0,0);
}

.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 360px;
    margin-right: 5%;
    perspective: 1000px;
    min-height: 580px; /* Changed from fixed height to min-height */
    max-height: 90vh; /* Prevent it from becoming too tall */
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.login-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.login-card.show-back .login-card-inner {
    transform: rotateY(180deg);
}

.login-card-front, .login-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.login-card-back {
    transform: rotateY(180deg);
}

.login-box {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    min-height: 100%; /* Changed to min-height instead of fixed height */
    height: auto; /* Allow height to expand based on content */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* This will push the terms text to the bottom */
}

.form-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

.input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

.submit-button {
    width: 100%;
    padding: 0.75rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .submit-button:hover {
        background-color: #0069d9;
    }

.captcha-display {
    background: #f0f0f0;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

.captcha-refresh-button {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .captcha-refresh-button:hover {
        background-color: #f0f0f0;
        color: #0056b3;
        transform: rotate(90deg);
    }

    .captcha-refresh-button:active {
        transform: rotate(360deg);
    }

.birthdate-instructions {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}

/* Additional classes for better layout management */
.login-content {
    flex: 1; /* This will take up available space */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-footer {
    margin-top: auto; /* This will push the footer to the bottom */
    padding-top: 1rem;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

/* ===== MINIMAL MOBILE ADJUSTMENTS ===== */
@media (max-width: 480px) {
    .login-container {
        justify-content: center;
        align-items: flex-start; /* Changed from center to flex-start to prevent cutting off */
        padding: 1rem;
        padding-top: 2rem; /* Add some top padding */
    }

    .login-card {
        margin-right: 0;
        max-width: 100%;
        min-height: auto; /* Remove minimum height constraint on mobile */
        max-height: none; /* Remove max height constraint on mobile */
        margin-top: 0;
        margin-bottom: 2rem; /* Add bottom margin for spacing */
        transform: translateZ(0); /* Hardware acceleration */
    }

    .login-box {
        padding: 1.5rem;
        background: rgba(255, 255, 255, 0.9);
        min-height: auto; /* Remove height constraints on mobile */
        height: auto;
        backface-visibility: hidden;
    }
}

/* For very small screens (iPhone 5/SE) */
@media (max-width: 320px) {
    .login-box {
        padding: 1.25rem;
    }

    .form-input {
        padding: 0.7rem 2rem 0.7rem 0.7rem;
    }
    
    .login-container {
        padding-top: 1rem; /* Reduce top padding on very small screens */
    }
}
