/* Theme Colors */
:root {
    --darkblue: #1a237e;
    --lightblue: #534bae;
    --error-red: #ff5252;
    --success-green: #4caf50;
    --btn-hover-color: #cba135;
    --btn-hover-bg: rgba(83,75,174,0.1);
    --card-header-bg: #003366;
}

/* Main container layout */
body {
    min-height: 100vh !important;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

}

.container {
    flex: 1 0 auto; /* This ensures the container takes up available space but allows the footer to maintain its height */
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}


/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Login box adjustments */
.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
    padding: 20px;
    margin: auto; /* Centers the login box */
    animation: fadeIn 0.5s ease-out;
}



/* Login Header */
.login-header {
    background: var(--darkblue);
    color: white;
    padding: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-header i {
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

/* App Info */
.app-info {
    text-align: center;
    margin-bottom: 2rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.app-info h2 {
    color: var(--darkblue);
    margin-bottom: 1rem;
}

.app-info p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.app-info a.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.app-info a.btn-secondary:hover {
    background-color: #5a6268;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--lightblue);
    box-shadow: 0 0 0 4px rgba(83,75,174,0.1);
    outline: none;
}

/* Code Input */
.code-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.code-square {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease-in-out;
}

.code-square:focus {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-block {
    width: 100%;
}

.btn-darkblue {
    background-color: var(--darkblue);
    color: white;
}

.btn-darkblue:hover {
    background-color: var(--btn-hover-color);
    transform: translateY(-1px);
}

.btn-link {
    color: var(--darkblue);
    text-decoration: none;
    padding: 0.5rem 1rem;
}

.btn-link:hover {
    color: var(--lightblue);
    background: var(--btn-hover-bg);
    border-radius: 6px;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-danger {
    background: rgba(255,82,82,0.1);
    border: 1px solid rgba(255,82,82,0.2);
    color: var(--error-red);
}

.alert-danger ul {
    margin: 0;
    padding-left: 1.5rem;
}

.alert-info {
    background: rgba(83,75,174,0.1);
    border: 1px solid rgba(83,75,174,0.2);
    color: var(--darkblue);
}

/* Card Styling */
.card-header {
    background-color: var(--card-header-bg);
    color: white;
    font-weight: bold;
    text-align: center;
    font-size: 18px;
}

.card-footer a {
    color: #223d66;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 40;
}

.custom-modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 10px;
    max-width: 90%;
    width: 600px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 50;
    font-size: 1.2em;
}


/* Footer adjustments */
.footer {
    flex-shrink: 0; /* Prevents footer from shrinking */
    background-color: var(--darkblue);
    color: white;
    box-shadow: 0 0 15px rgba(83, 75, 174, 0.8);
    border-top: 3px solid var(--lightblue);
    width: 100%;
}

.footer .glowing-footer {
    padding: 1.5rem;
}

.glowing-footer {
    animation: glowEffect 2s infinite alternate;
}

.glowing-footer a {
    color: var(--lightblue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.glowing-footer a:hover {
    color: white;
    text-shadow: 0 0 8px var(--lightblue);
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes glowEffect {
    0% {
        box-shadow: 0 0 10px rgba(83, 75, 174, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(83, 75, 174, 1);
    }
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-body {
        padding: 1.5rem;
    }

    .code-square {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .glowing-footer {
        padding: 1rem;
    }
    
    .container {
        padding-bottom: 80px; /* Smaller padding for mobile */
    }
    
    .login-box {
        margin-bottom: 100px; /* Adjusted for mobile */
    }
}