/* ============================================
   INDEX.CSS - Main Entry Page
   Responsive, Robust, Polished
   ============================================ */

:root {
    --cor-fundo: #ffffff;
    --cor-texto: #000000;
    --cor-imagem-bg: #0078D7;
    --padding-wrapper: 0;
    --imagem-max-width: 100vw;
    --imagem-max-height: 100vh;
    --user-select: none;
    --pointer-events: auto;
    --touch-action: pan-x pan-y;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Interactive Elements */
a,
button,
input,
select,
textarea,
[role="button"],
[onclick] {
    pointer-events: auto !important;
    cursor: pointer;
    touch-action: manipulation;
}

/* ============================================
   BASE STYLES
   ============================================ */

html {
    width: 100%;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--cor-fundo);
    color: var(--cor-texto);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ============================================
   MAINTENANCE WRAPPER
   ============================================ */

.maintenance-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0078D7 !important;
    pointer-events: auto;
}

.maintenance-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.maintenance-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    pointer-events: auto;
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    touch-action: manipulation;
    cursor: pointer;
}

/* Zoomed State */
.maintenance-image.zoomed {
    position: fixed !important;
    width: auto !important;
    height: 90vh !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    transform: translate(-50%, -50%) scale(1.2) !important;
    z-index: 9999 !important;
    background: transparent;
    pointer-events: auto !important;
}

.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: none;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.zoom-overlay-dark {
    background: rgba(0, 120, 215, 0.85);
}

/* ============================================
   ENTER BUTTON
   ============================================ */

.enter-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #ffffff;
    text-decoration: none;
    z-index: 10000;
    border-radius: 12px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.enter-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.enter-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.enter-btn i {
    font-size: 22px;
}

/* ============================================
   RESPONSIVE - LARGE DESKTOPS (1440px+)
   ============================================ */

@media (min-width: 1440px) {
    .enter-btn {
        top: 32px;
        right: 32px;
        width: 52px;
        height: 52px;
    }

    .enter-btn i {
        font-size: 24px;
    }
}

/* ============================================
   RESPONSIVE - TABLETS (768px - 1024px)
   ============================================ */

@media (max-width: 1024px) {
    .enter-btn {
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .enter-btn {
        top: 18px;
        right: 18px;
        width: 46px;
        height: 46px;
    }

    .enter-btn i {
        font-size: 20px;
    }
}

/* ============================================
   RESPONSIVE - SMALL TABLETS (600px)
   ============================================ */

@media (max-width: 600px) {
    .maintenance-image {
        max-width: 100%;
        max-height: 100%;
    }

    .maintenance-image.zoomed {
        height: 88vh !important;
        max-width: 95vw !important;
        transform: translate(-50%, -50%) scale(1.15) !important;
    }
}

/* ============================================
   RESPONSIVE - MOBILE PHONES (480px)
   ============================================ */

@media (max-width: 480px) {
    .maintenance-image {
        width: 100%;
        height: auto;
        touch-action: manipulation;
    }

    .maintenance-image.zoomed {
        width: auto !important;
        height: 85vh !important;
        max-width: 95vw !important;
        max-height: 85vh !important;
        transform: translate(-50%, -50%) scale(1.1) !important;
    }

    .enter-btn {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .enter-btn i {
        font-size: 18px;
    }
}

/* ============================================
   RESPONSIVE - SMALL PHONES (360px)
   ============================================ */

@media (max-width: 360px) {
    .enter-btn {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }

    .enter-btn i {
        font-size: 17px;
    }

    .maintenance-image.zoomed {
        height: 80vh !important;
        transform: translate(-50%, -50%) scale(1.05) !important;
    }
}

/* ============================================
   RESPONSIVE - ORIENTATION
   ============================================ */

@media (orientation: portrait) {
    .maintenance-image {
        width: auto;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
    }
}

@media (orientation: landscape) {
    .maintenance-image {
        width: 100%;
        height: auto;
        max-width: 100vw;
    }
}

/* Landscape mobile - limited height */
@media (max-height: 500px) and (orientation: landscape) {
    .enter-btn {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .enter-btn i {
        font-size: 16px;
    }

    .maintenance-image.zoomed {
        height: 85vh !important;
        transform: translate(-50%, -50%) scale(1.05) !important;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    .enter-btn {
        min-width: 48px;
        min-height: 48px;
    }

    .enter-btn:hover {
        opacity: 1;
        transform: none;
    }

    .enter-btn:active {
        transform: scale(0.95);
        opacity: 0.85;
    }

    .zoom-overlay {
        touch-action: manipulation;
    }
}

/* ============================================
   SAFE AREAS (iPhone X+, notched devices)
   ============================================ */

@supports (padding: max(0px)) {
    .enter-btn {
        top: max(24px, env(safe-area-inset-top, 24px));
        right: max(24px, env(safe-area-inset-right, 24px));
    }

    @media (max-width: 480px) {
        .enter-btn {
            top: max(16px, env(safe-area-inset-top, 16px));
            right: max(16px, env(safe-area-inset-right, 16px));
        }
    }

    @media (max-width: 360px) {
        .enter-btn {
            top: max(12px, env(safe-area-inset-top, 12px));
            right: max(12px, env(safe-area-inset-right, 12px));
        }
    }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .maintenance-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: high-quality;
    }
}

/* ============================================
   DARK/LIGHT MODE
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --cor-fundo: #000000;
        --cor-texto: #ffffff;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --cor-fundo: #ffffff;
        --cor-texto: #000000;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .enter-btn {
        transition: none;
    }

    .enter-btn:hover,
    .enter-btn:active {
        transform: none;
    }
}

/* ============================================
   TV / LARGE SCREENS (1920px+)
   ============================================ */

@media (min-width: 1920px) {
    .enter-btn {
        top: 40px;
        right: 40px;
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .enter-btn i {
        font-size: 26px;
    }
}

@media (min-width: 2560px) {
    .enter-btn {
        top: 48px;
        right: 48px;
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .enter-btn i {
        font-size: 30px;
    }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .enter-btn {
        display: none;
    }

    .maintenance-wrapper {
        background: #0078D7 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}