/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-size: 16px;
}

body {
    height: 100vh;
    /* Fix for -webkit browsers to properly calculate height */
    height: -webkit-fill-available;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    /* Fallback background if video fails */
    background: #1a1a1a;
    /* Prevent bounce/scroll on iOS */
    position: fixed;
    width: 100%;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container and layout */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
    /* Fix for -webkit browsers to properly calculate height */
    height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure container doesn't overflow on iOS */
    max-height: 100%;
}

/* Background video styling */
.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use contain instead of cover for iPhone to prevent zooming/cropping */
    -webkit-object-fit: contain;
    object-fit: contain;
    z-index: -1;
    /* Center the video */
    -webkit-object-position: center center;
    object-position: center center;
    overflow: hidden;
    /* Ensure the video fills the screen */
    min-height: 100%;
    min-width: 100%;
    /* For iPhone specifically */
    max-width: 100vw;
    max-height: 100vh;
}

/* Mobile video visible by default */
.desktop-video {
    display: none;
}

.mobile-video {
    display: block;
}

/* iPhone-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS-specific styles */
    .background-video {
        position: fixed;
        width: 100vw;
        height: 100vh;
        object-fit: cover;
        transform: none;
    }
    
    .container {
        position: fixed;
        width: 100vw;
        height: 100vh;
    }
}

/* Overlay for content */
.overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed dark overlay */
}

/* Form container */
.form-container {
    width: 90%;
    max-width: 300px; /* 25% smaller than original 400px */
    padding: 1.5rem; /* Slightly reduced padding to maintain proportions */
    background: rgba(255, 255, 255, 0.75); /* More transparent */
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    /* Use -webkit prefix for iOS compatibility */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(0.75); /* Additional 25% reduction in size */
    transform-origin: center center;
    /* Ensure form is visible on iOS */
    z-index: 10;
}

/* Form styling */
#email-octopus-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#email-octopus-form input {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

#email-octopus-form input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

#email-octopus-form input::placeholder {
    color: #666;
}

/* Submit button */
.submit-btn {
    padding: 0.875rem 2rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.submit-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.3);
}

/* Button text */
.btn-text {
    display: block;
}

/* No-script message */
.noscript-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    text-align: center;
    z-index: 1000;
    border-bottom: 1px solid #f5c6cb;
}

/* Video fallback styles */
.video-fallback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.video-fallback .background-video {
    display: none;
}

/* Additional fallback for when videos fail to load */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 50%, #1a1a1a 100%);
    z-index: -2;
}

/* Tablet breakpoint (768px and up) */
@media screen and (min-width: 768px) {
    .form-container {
        max-width: 337px; /* 25% smaller than original 450px */
        padding: 1.875rem; /* 25% smaller padding */
    }
    
    #email-octopus-form input {
        padding: 0.75rem 0.94rem; /* Slightly reduced padding */
        font-size: 1rem;
    }
    
    .submit-btn {
        padding: 0.75rem 1.875rem; /* Slightly reduced padding */
        font-size: 1rem;
    }
}





/* Desktop breakpoint (769px and up) */
@media screen and (min-width: 769px) {
    /* Switch to desktop video */
    .desktop-video {
        display: block;
    }
    
    .mobile-video {
        display: none;
    }
    
    .form-container {
        max-width: 375px; /* 25% smaller than original 500px */
        padding: 2.25rem; /* 25% smaller padding */
    }
    
    #email-octopus-form input {
        padding: 0.84rem 1.125rem; /* Slightly reduced padding */
        font-size: 1.05rem;
    }
    
    .submit-btn {
        padding: 0.84rem 2.25rem; /* Slightly reduced padding */
        font-size: 1.05rem;
    }
    
    /* Enhanced hover effects for desktop */
    .submit-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }
}

/* Large desktop (1200px and up) */
@media screen and (min-width: 1200px) {
    .form-container {
        max-width: 412px; /* 25% smaller than original 550px */
        padding: 2.625rem; /* 25% smaller padding */
    }
}

/* High DPI displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .form-container {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    #email-octopus-form input,
    .submit-button {
        transition: none;
    }
    
    .submit-button:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .form-container {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    #email-octopus-form input {
        background: #2a2a2a;
        border-color: #404040;
        color: #fff;
    }
    
    #email-octopus-form input::placeholder {
        color: #999;
    }
    
    #email-octopus-form input:focus {
        border-color: #666;
        box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.2);
    }
}

/* Print styles */
@media print {
    .background-video,
    .overlay {
        display: none;
    }
    
    .container {
        background: #fff;
        height: auto;
    }
    
    .form-container {
        background: #fff;
        box-shadow: none;
        border: 1px solid #000;
        max-width: none;
        width: 100%;
    }
}
