* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    position: relative;
}

html {
    width: 100%;
    height: 100%;
}

.page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: block;
}

.page.hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* ========================================= */
/* СТРАНИЦА 2 - ОСНОВНАЯ */
/* ========================================= */
.page-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    overflow: hidden;
}

.splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: filter 0.5s ease;
}

.splash-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    display: block;
    -ms-interpolation-mode: bicubic;
}

.splash-screen.blurred {
    filter: blur(12px) brightness(0.6);
    -webkit-filter: blur(12px) brightness(0.6);
}

/* Капча */
.captcha-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    -webkit-transition: opacity 0.5s ease;
}

.captcha-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.captcha-box {
    width: 360px;
    max-width: 90%;
    background: #f9f9fa;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border: 1px solid #dadce0;
    transition: all 0.3s;
    margin: 0 auto;
}

/* Адаптация капчи под разные разрешения */
@media (min-width: 2560px) {
    .captcha-box {
        width: 450px;
    }
    .captcha-logo {
        font-size: 16px;
    }
    .captcha-label {
        font-size: 16px;
    }
    .captcha-box-footer {
        font-size: 12px;
    }
}

@media (max-width: 1366px) {
    .captcha-box {
        width: 330px;
    }
}

@media (max-width: 768px) {
    .captcha-box {
        width: 320px;
    }
    .captcha-box-header {
        padding: 12px 16px;
    }
    .captcha-box-content {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .captcha-box {
        width: 95%;
    }
    .captcha-box-header {
        padding: 12px 14px;
    }
    .captcha-box-content {
        padding: 18px 14px;
    }
    .captcha-label {
        font-size: 14px;
    }
}

.captcha-box-header {
    background: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8eaed;
    flex-wrap: wrap;
    gap: 10px;
}

.captcha-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
}

.captcha-links {
    color: #9aa0a6;
    font-size: 12px;
}

.captcha-box-content {
    background: white;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.captcha-checkbox-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}

.checkbox-container {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.captcha-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #5f6368;
    border-radius: 4px;
    background: white;
    transition: all 0.15s;
    position: absolute;
    top: 0;
    left: 0;
}

.captcha-checkbox.checked {
    background: #1a73e8;
    border-color: #1a73e8;
}

.captcha-checkbox.checked::after {
    content: "✓";
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    -webkit-animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

.captcha-label {
    color: #202124;
    font-size: 15px;
}

.captcha-icon {
    opacity: 0.7;
    flex-shrink: 0;
}

.captcha-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.captcha-box-footer {
    background: #f1f3f4;
    padding: 12px 18px;
    font-size: 11px;
    color: #5f6368;
    border-top: 1px solid #e8eaed;
}

/* ========================================= */
/* СТРАНИЦА 3 - ПОЛНОЭКРАННОЕ ФОТО */
/* ========================================= */
.page-3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 3000;
}

.fullscreen-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.fullscreen-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: bicubic;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    -webkit-transition: 0.2s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.8);
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
}

/* ========================================= */
/* АДАПТАЦИЯ ДЛЯ EDGE/IE */
/* ========================================= */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .page-2, .page-3 {
        position: absolute;
        height: 100%;
    }
}

@supports (-ms-ime-align: auto) {
    .page-2, .page-3 {
        position: absolute;
        height: 100%;
    }
    
    .captcha-box {
        margin: 0 auto;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .close-btn {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .close-btn {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Для 4K */
@media (min-width: 3840px) {
    .captcha-box {
        width: 500px;
    }
    .captcha-logo {
        font-size: 18px;
    }
    .captcha-label {
        font-size: 18px;
    }
    .captcha-box-footer {
        font-size: 14px;
    }
    .close-btn {
        width: 70px;
        height: 70px;
        font-size: 30px;
    }
}