* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    padding: 30px 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-side-column,
.login-form-column {
    width: 100%;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #405;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: center;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: #8b5;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: #bbb;
}

.quality-group {
    margin-bottom: 20px;
}

.quality-options {
    display: flex;
    gap: 10px;
}

.quality-btn {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(139, 181, 85, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .quality-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(139, 181, 85, 0.6);
    }
}

.quality-btn.active {
    background: linear-gradient(135deg, rgba(139, 181, 85, 0.5), rgba(184, 217, 88, 0.5));
    border-color: #8b5;
    color: #fff;
    box-shadow: 0 0 15px rgba(139, 181, 85, 0.6);
}

#quality-hidden {
    display: none;
}

.error-message {
    background: rgba(220, 53, 69, 0.3);
    border: 1px solid #dc3545;
    color: #fff;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) {
    button:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }
}

button:active {
    transform: translateY(0);
}

#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: -1;
    display: none;
    background: #000;
}

body.video-loaded {
    background-image: none;
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 15px;
        margin: 10px;
        border-radius: 5px;
        box-shadow: none;
        max-width: 100%;
    }
    
    .logo img {
        max-width: 100%;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    input[type="text"],
    input[type="password"] {
        padding: 10px;
        font-size: 16px;
    }
    
    button {
        padding: 10px;
        font-size: 15px;
    }
    
    .quality-options {
        flex-direction: row;
        gap: 10px;
    }
    
    .quality-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    body {
        align-items: center;
        padding: 4px 0;
        overflow-y: auto;
        background-attachment: scroll;
    }

    .login-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
        column-gap: 18px;
        width: min(940px, calc(100vw - 8px));
        min-height: calc(100dvh - 8px);
        padding: 0;
        margin: 0 auto;
    }

    .login-side-column {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 16px;
        min-height: 0;
    }

    .logo img {
        width: min(100%, 380px);
        max-height: calc(100dvh - 88px);
    }

    #aboutThis {
        margin-bottom: 0;
        width: 100%;
    }

    .login-form-column {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 100%;
    }

    .login-form-column form {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 100%;
    }

    .form-group,
    .quality-group,
    .error-message {
        margin-bottom: 10px;
    }

    label {
        margin-bottom: 4px;
        font-size: 14px;
    }

    input[type="text"],
    input[type="password"],
    button,
    .quality-btn {
        padding: 10px 12px;
        font-size: 15px;
    }

    #speed-test-result {
        min-height: 18px !important;
        margin-bottom: 3px !important;
        font-size: 12px !important;
    }

    .quality-options {
        gap: 10px;
    }

    #retest-speed-btn {
        font-size: 11px !important;
        margin-bottom: 6px;
    }

    .login-container p a {
        padding: 10px 14px;
        font-size: 14px;
        text-align: center;
        width: min(100%, 280px);
    }
}

@media (orientation: landscape) and (max-height: 430px) {
    body {
        padding: 3px 0;
    }

    .login-container {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 14px;
        width: min(900px, calc(100vw - 6px));
        min-height: calc(100dvh - 6px);
        padding: 0;
    }

    .login-side-column {
        gap: 12px;
    }

    .logo img {
        width: min(100%, 320px);
        max-height: calc(100dvh - 74px);
    }

    label {
        font-size: 13px;
    }

    input[type="text"],
    input[type="password"],
    button,
    .quality-btn {
        padding: 9px 11px;
        font-size: 14px;
    }

    .login-container p a {
        width: min(100%, 260px);
    }

    .form-group,
    .quality-group,
    .error-message {
        margin-bottom: 6px;
    }

    input[type="text"],
    input[type="password"],
    button,
    .quality-btn {
        padding: 7px 9px;
        font-size: 12px;
    }

    .quality-btn {
        line-height: 1.2;
    }

    #speed-test-result {
        min-height: 14px !important;
        font-size: 10px !important;
    }
}

/* Info Lightbox */
.info-lightbox {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.info-lightbox.active {
    display: flex !important;
}

.info-lightbox-content {
    position: relative;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid rgba(139, 181, 85, 0.5);
    border-radius: 10px;
    padding: 40px 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 40px rgba(139, 181, 85, 0.3);
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.info-lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(139, 181, 85, 0.5);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .info-lightbox-close:hover {
        background: rgba(139, 181, 85, 0.3);
        border-color: #8b5;
        transform: scale(1.1);
    }
}

.info-lightbox-content h2 {
    color: #8b5;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(139, 181, 85, 0.5);
}

.info-lightbox-text {
    color: #ddd;
    font-size: 15px;
    line-height: 1.6;
}

.info-lightbox-text p {
    margin-bottom: 15px;
}

.info-lightbox-text p:last-child {
    margin-bottom: 0;
}

.info-lightbox-text strong {
    color: #8b5;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Info link styling */
.login-container p a {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 500;
    font-size: 14px;
}

@media (hover: hover) {
    .login-container p a:hover {
        background: rgba(139, 181, 85, 0.4);
        color: #8b5;
        box-shadow: 0 0 10px rgba(139, 181, 85, 0.3);
    }
}

/* About This rotating lines */
.about-line {
    display: none;
}

.about-line.active {
    display: inline;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* PWA Install Banner */
.pwa-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #000;
    padding: 12px 20px;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.pwa-banner-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.pwa-banner-icon {
    font-size: 20px;
}

.pwa-banner-message {
    flex: 1;
}

.pwa-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pwa-banner-btn-install,
.pwa-banner-btn-dismiss {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pwa-banner-btn-install {
    background: #fff;
    color: #00d4ff;
}

.pwa-banner-btn-install:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.pwa-banner-btn-install:active {
    transform: scale(0.98);
}

.pwa-banner-btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: #000;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pwa-banner-btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
    .pwa-banner {
        padding: 10px 15px;
    }
    
    .pwa-banner-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .pwa-banner-text {
        font-size: 14px;
        width: 100%;
    }
    
    .pwa-banner-actions {
        width: 100%;
    }
    
    .pwa-banner-btn-install {
        flex: 1;
    }
}
