* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    background-color: #333;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

body {
    line-height: 1.6;
    color: #333;
    background: linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)), url('../images/Uc-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative !important;
    overflow: hidden !important;
}

body.modal-open {
    overflow: hidden !important;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #4a90e2, #5637d9);
    color: white;
    padding: 1rem 0;
    width: 100%;
    box-shadow: 0 12px 30px rgba(29, 71, 134, 0.25);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 55%),
                radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 45%);
    pointer-events: none;
}

.navbar {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
    flex-wrap: nowrap;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 6px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in-out;
}

.alert-danger {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
}

.alert-success {
    background-color: #f0fdf4;
    border-left: 4px solid #10b981;
    color: #047857;
}

.alert-content {
    flex: 1;
}

.alert strong {
    display: block;
    margin-bottom: 5px;
}

.alert ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.alert ul li {
    margin-bottom: 5px;
}

.alert ul li:last-child {
    margin-bottom: 0;
}

.alert-close {
    margin-left: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0 5px;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: 0.5px;
    text-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.logo-img {
    height: 64px;
    width: auto;
    display: block;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.85;
}

.menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 1.35rem;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.55rem 0.85rem;
    transition: all 0.3s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: auto;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    position: relative;
}

.nav-links a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus {
    background-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
    opacity: 1;
}

.nav-links .cta-link {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
}

.nav-links .cta-link:hover,
.nav-links .cta-link:focus {
    background-color: #ff7f50;
    border-color: #ffb294;
    color: white;
    transform: translateY(-2px) scale(1.02);
}

/* Main Content Styles */
main {
    flex: 1 1 auto;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Login Form Styles */
.login-container {
    max-width: 400px;
    width: 95%;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 1.25rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-header h1 {
    font-size: 1.6rem;
    color: #4a90e2;
    margin-bottom: 0.4rem;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

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

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

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #4a90e2;
    outline: none;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-footer a {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.9rem;
}

.form-footer a:hover {
    text-decoration: underline;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input {
    margin-right: 0.5rem;
    min-width: 16px;
    min-height: 16px;
}

.cta-btn {
    background-color: #ff7f50;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    width: 100%;
    font-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

.cta-btn:hover, .cta-btn:active {
    background-color: #ff6b3d;
    transform: translateY(-2px);
}

.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    color: #666;
    font-size: 0.9rem;
}

.login-footer a {
    color: #4a90e2;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.social-login {
    margin-top: 2rem;
    text-align: center;
}

.social-login p {
    position: relative;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.social-login p::before,
.social-login p::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background-color: #ddd;
}

.social-login p::before {
    left: 0;
}

.social-login p::after {
    right: 0;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    width: 120px;
    touch-action: manipulation; /* Improves touch behavior */
}

.social-btn:hover, .social-btn:active {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

.social-icon {
    margin-right: 0.5rem;
    font-weight: bold;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 1rem 0;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    padding: 0.3rem 0;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    font-size: 0.9rem;
    color: #aaa;
    text-align: center;
    width: 100%;
    margin-top: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0 1.5rem;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-left: 0;
        margin-top: 0.5rem;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-links a {
        text-align: center;
        padding: 0.85rem 1rem;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-links.active {
        max-height: 260px;
        opacity: 1;
        visibility: visible;
        padding-bottom: 0.75rem;
    }
    
    .login-container {
        padding: 1.5rem 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .form-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .social-buttons {
        flex-direction: row;
    }
    
    .social-btn {
        width: 45%;
    }
    
    /* Fix for better touch targets */
    .nav-links a, .footer-links a {
        padding: 0.5rem 0;
        display: block;
    }
    
    /* Improve spacing for small screens */
    main {
        padding: 0.75rem 0;
    }
    
    .login-header h1 {
        font-size: 1.4rem;
    }
    
    .login-container {
        padding: 1.25rem 1rem;
    }
    
    header {
        padding: 0.75rem 0;
    }
    
    footer {
        padding: 0.75rem 0;
    }
}

/* Fix for very small screens */
@media (max-width: 360px) {
    .form-footer {
        justify-content: flex-start;
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .social-btn {
        width: 100%;
    }
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio:0) { 
    select,
    textarea,
    input {
        font-size: 16px;
    }
}

/* Footer Modal Styles */
.footer-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.footer-modal.show {
    display: flex;
    opacity: 1;
}

.footer-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.footer-modal.show .footer-modal-content {
    transform: translateY(0);
}

.footer-modal-header {
    background: linear-gradient(135deg, #4a90e2, #5637d9);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.footer-modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.6;
}

.footer-modal-body h3 {
    color: #2c3e50;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.footer-modal-body p {
    margin-bottom: 1rem;
    color: #555;
}

.footer-modal-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.footer-modal-body li {
    margin-bottom: 0.5rem;
    color: #555;
}

.footer-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.footer-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Email Link Styling in Footer Modal */
.footer-modal-body a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
}

.footer-modal-body a:hover {
    text-decoration: underline;
}

/* Responsive styles for footer modals */
@media (max-width: 768px) {
    .footer-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .footer-modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .footer-modal-header h2 {
        font-size: 1.3rem;
    }
    
    .footer-modal-body {
        padding: 1.5rem;
        max-height: 65vh;
    }
}