html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body {
    font-family: 'Poppins', sans-serif;
}

/* Logo Styling */
.logo {
    width: 200px;
    height: auto;
    max-width: 100%; /* Ensure it doesn't overflow on small screens */
}

#logo-container {
    visibility: hidden;
}

/* This class will be added via JS when WebP is supported */
.webp-supported #logo-container {
    visibility: visible;
}

/* Navigation Link Styling */
.nav-link {
    margin-right: 20px;
    font-weight: 500;
}

/* Header Section Styling */
header {
    margin-top: 0;
    padding-bottom: 5px;
}

/* Hero Section Styling */
.hero-section {
    background-color: #f8f9fa;
    padding: 100px 0;
    display: flex;
    align-items: center;
}

.hero-section .display-4 {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
}

.hero-section .lead {
    color: #555;
    margin-top: 20px;
    font-size: 1.2rem;
}

.hero-section .btn-primary {
    background-color: #007bff;
    border: none;
    font-size: 1rem;
    padding: 10px 30px;
}

.btn-primary {
    max-width: 200px;
    padding: 10px 20px;
    white-space: nowrap;
    text-align: center;
}

.hero-section .img-fluid {
    max-width: 90%;
    height: auto;
}

/* Operators Section */
.operators-section {
    background-color: #f8f9fa;
    padding: 50px 0;
}

.operators-section h2 {
    color: #333;
}

.operators-section p.lead {
    color: #555;
}

.operators-section h4 {
    color: #333;
    margin-bottom: 15px;
}

.operators-section p {
    color: #555;
    line-height: 1.6;
}

.operators-section .row .col-lg-3 {
    margin-bottom: 30px;
}

.partner-logo {
    width: 100%;
    max-width: 150px;
    height: 100px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Revolution Section */
.revolution-section {
    background-color: #f8f9fa;
    padding: 50px 0;
}

.revolution-section h2 {
    color: #333;
}

.revolution-section p.lead {
    color: #555;
    font-size: 1.1rem;
}

.revolution-section .qr-code img {
    width: 150px;
    height: auto;
}

.revolution-section p {
    color: #333;
    margin-top: 15px;
    font-size: 1.1rem;
}

/* Footer Section Styling */
footer {
    background-color: #1e1d3b;
    color: #fff;
    padding: 50px 0;
}

footer h5 {
    font-weight: bold;
    margin-bottom: 20px;
    color: #fff;
}

footer p, footer a {
    font-size: 0.9rem;
    color: #ccc;
    text-decoration: none;
}

footer a:hover {
    color: #007bff !important;
}

.footer-col {
    padding: 0 80px;
    margin-bottom: 40px;
}

footer ul {
    padding-left: 0;
    list-style-type: none;
}

footer .list-unstyled li {
    margin-bottom: 10px;
}

footer a {
    transition: color 0.3s ease;
}

footer .row {
    justify-content: space-between;
}

/* Login Form Styles */
.login-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    margin-top: 6rem;
    margin-bottom: 6rem;
}

.login-logo {
    margin-bottom: 2rem;
    text-align: center;
}

.login-logo img {
    width: 120px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background-color: #f8f9fc;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a89dc;
    background-color: #fff;
}

.remember-me {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.remember-me input[type="checkbox"] {
    margin-right: 0.5rem;
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background-color: #4a89dc;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: #357abd;
}

.signup-link {
    text-align: center;
    margin-top: 1.5rem;
}

.signup-link a {
    color: #4a89dc;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password a:hover {
    color: #4a89dc;
}

.contact-support {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.contact-support a {
    color: #4a89dc;
    text-decoration: none;
}

/* Error and Success Messages */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #fff5f5;
    color: #dc3545;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #f4fdf6;
    color: #28a745;
    border: 1px solid #c3e6cb;
}

/* Password Toggle */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    background: none;
    border: none;
    padding: 0;
}

.back-to-login {
    text-align: center;
    margin-top: 1rem;
}

.btn-outline {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #0066ff;
    border-radius: 4px;
    color: #0066ff;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-outline:hover {
    background-color: #0066ff;
    color: white;
    text-decoration: none;
}

/* Improve error message display */
.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.invalid-feedback.is-invalid {
    display: block;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* ===== RESPONSIVE STYLES ===== */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .footer-col {
        padding: 0 40px;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 10px;
    }
    
    .navbar-collapse .d-flex {
        margin-top: 15px;
    }
    
    .hero-section .display-4 {
        font-size: 2.2rem;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .footer-col {
        padding: 0 30px;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 60px 0;
        text-align: center;
    }
    
    .hero-section .img-fluid {
        margin-top: 30px;
    }
    
    .footer-col {
        padding: 0 15px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .hero-section .display-4 {
        font-size: 1.8rem;
    }
    
    .logo {
        width: 150px;
    }
    
    .btn-primary {
        padding: 8px 16px;
    }
}

/* ===== TABLET-SPECIFIC STYLES ===== */

/* iPad and other tablets */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
    /* General tablet adjustments */
    .logo {
        width: 160px;
    }
    
    .navbar-collapse {
        padding-top: 10px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
    }
    
    .btn-primary {
        padding: 8px 16px;
        margin-bottom: 5px;
    }
    
    main {
        flex: 1 0 auto;
    }
    
    .footer-col {
        padding: 0 20px;
        min-height: 180px;
    }
    
    /* Force hardware acceleration to fix rendering issues */
    .hero-section, 
    .operators-section, 
    .revolution-section {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
}

/* iPad in portrait orientation */
@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .navbar-collapse {
        text-align: center;
    }
    
    .navbar-collapse .d-flex {
        justify-content: center;
        margin-top: 10px;
        width: 100%;
    }
    
    .nav-link {
        margin-right: 10px;
        margin-left: 10px;
    }
    
    .hero-section {
        padding: 60px 0;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2.2rem;
    }
    
    .hero-section .img-fluid {
        margin-top: 30px;
    }
}

/* iPad in landscape orientation */
@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .navbar-collapse {
        justify-content: flex-end;
    }
    
    .navbar-nav {
        margin-right: 15px;
    }
    
    .hero-section {
        padding: 70px 0;
    }
    
    .hero-section .display-4 {
        font-size: 2.3rem;
    }
}

/* iPad Pro */
@media only screen and (min-width: 1024px) and (max-width: 1366px) and (-webkit-min-device-pixel-ratio: 2) {
    .footer-col {
        padding: 0 30px;
    }
    
    .navbar-collapse .d-flex {
        margin-left: 10px;
    }
}

/* Fix for newer iPad models with specific dimensions */
@media only screen and (width: 820px) and (height: 1180px), 
       only screen and (width: 834px) and (height: 1194px),
       only screen and (width: 768px) and (height: 1024px),
       only screen and (width: 810px) and (height: 1080px) {
    .navbar-collapse {
        flex-direction: column;
        align-items: center;
    }
    
    .navbar-collapse .d-flex {
        margin-top: 15px;
    }
}

/* Force proper block rendering in Safari on iOS */
@supports (-webkit-overflow-scrolling: touch) {
    .logo {
        display: inline-block;
    }
    
    .hero-section, 
    .operators-section, 
    .revolution-section {
        -webkit-transform: translate3d(0,0,0);
        transform: translate3d(0,0,0);
    }
}