/* Login screen styles - Optimized for all TV resolutions */

/* Ensure proper scaling for all TV resolutions */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Default 16:9 TV aspect ratio support */
    aspect-ratio: 16/9;
}

/* Main container styles with SafeArea considerations for TV */
.login-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000000;
    color: white;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Add TV-safe area padding (10% from edges) */
    padding: 5% 10%;
}

.login-card {
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 4% 5%;
    width: 80%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(237, 28, 36, 0.2);
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    width: 25%;
    min-width: 150px;
    max-width: 200px;
    margin-bottom: 3%;
    object-fit: contain;
}

.welcome-text {
    font-size: min(32px, 4vw);
    margin-bottom: 3%;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.qr-title {
    font-size: min(22px, 3vw);
    margin-bottom: 2%;
    color: #ffffff;
    text-align: center;
}

.qr-container {
    background-color: white;
    padding: 3%;
    border-radius: 15px;
    margin: 3% auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease-out;
    /* QR code responsive size without stretching */
    width: min(256px, 40%);
    height: auto;
    border: 3px solid #ED1C24;
}

.qr-container img {
    width: 100%;
    height: auto;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-instructions {
    margin: 3% 0;
    font-size: min(18px, 2.5vw);
    line-height: 1.6;
    color: #ffffff;
    text-align: left;
    width: 100%;
}

.login-instructions ol {
    padding-left: 25px;
}

.login-instructions li {
    margin-bottom: 10px;
}

.status-message {
    font-size: min(18px, 2.5vw);
    padding: 15px;
    margin: 3% 0;
    border-radius: 8px;
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

@keyframes fadeInOut {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

.status-message.error {
    background: rgba(237, 28, 36, 0.1);
    color: #ED1C24;
    animation: none;
}

.retry-button {
    padding: 12px 30px;
    font-size: min(18px, 2.5vw);
    background-color: #ED1C24;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 3%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.retry-button:hover {
    background-color: #c10a11;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.retry-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.retry-button.hidden {
    display: none;
}

.help-text {
    margin-top: 5%;
    font-size: min(14px, 2vw);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* For TV navigation focus */
.retry-button:focus {
    outline: 3px solid #ED1C24;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.5);
}

/* Specific aspect ratio adjustments */
/* For 4:3 TVs (older models) */
@media screen and (aspect-ratio: 4/3) {
    .login-card {
        width: 90%;
        padding: 4%;
    }

    .qr-container {
        width: 35%;
    }
}

/* For 21:9 TVs (ultra-wide) */
@media screen and (aspect-ratio: 21/9) {
    .login-card {
        width: 60%;
        max-width: 1000px;
    }
}

/* Resolution-specific adjustments */
/* For SD TVs (720p and below) */
@media screen and (max-width: 1280px) {
    .login-card {
        width: 90%;
        padding: 30px;
    }

    .welcome-text {
        font-size: min(28px, 4vw);
    }

    .qr-title {
        font-size: min(20px, 3vw);
    }

    .qr-container {
        width: min(220px, 40%);
    }
}

/* For very low resolutions */
@media screen and (max-width: 768px) {
    .login-card {
        width: 95%;
        padding: 20px;
    }

    .welcome-text {
        font-size: min(24px, 5vw);
    }

    .login-instructions {
        font-size: min(16px, 3vw);
    }

    .qr-container {
        width: min(200px, 50%);
    }
}