/* Mobile-specific optimizations for Matrix Registration */

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* For touch devices */
    .btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .form-control {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .form-control:focus {
        font-size: 16px;
        zoom: 1;
    }
    
    input[type="text"]:focus {
        font-size: 16px;
    }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .form-control {
        background-clip: padding-box;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .password-strength-fill {
        transition: none;
    }
    
    .login-requirements,
    .password-requirements {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed in the future */
}

/* Orientation change handling */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .py-5 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* PWA-like full-screen experience */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Performance optimization for mobile */
.card, .btn, img, video {
    will-change: auto;
}

/* Improve tap highlight */
.btn, .btn-link, a {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Better scrolling on mobile */
body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Fix for mobile Safari bottom bar */
@supports (-webkit-touch-callout: none) {
    .container {
        min-height: calc(100vh - env(keyboard-inset-height, 0px));
    }
}