:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f0f2f5;
    --white-color: #ffffff;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ensure everything inside login uses border-box to avoid overflow */
.login-container, .login-container * {
    box-sizing: border-box;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* avoid vertical clipping on short viewports */
    min-height: 100vh;
    min-height: 100svh; /* mobile safe viewport height */
    background-color: var(--background-color);
    padding: 20px;
    overflow: visible; /* allow page to scroll if needed */
}

.login-box {
    display: flex;
    width: 100%;
    max-width: 900px;
    background-color: var(--white-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: visible; /* remove clipping so nothing is hidden */
    margin-top: 20px;
}

.login-promo, .login-form-section {
    width: 50%;
    padding: 50px 40px;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.login-promo {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: var(--white-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-promo h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.login-promo p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
}

.features-list .fas {
    font-size: 1.2rem;
    margin-right: 15px;
    width: 25px;
    text-align: center;
}

.login-form-section {
    display: flex;
    flex-direction: column;
    padding: 50px 40px;
    min-height: 500px; /* Ensure enough space for content */
    align-items: center; /* center inner content horizontally */
}

.login-header {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-section h2 {
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 10px;
    text-align: center;
}

.login-form-section .subtitle {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form {
    width: 100%;
    max-width: 420px; /* prevent very wide inputs from touching edges */
    margin: 0 auto;
    padding-inline: 4px; /* safe padding to avoid edge overflow */
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.login-form input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; /* prevent exceeding parent width */
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: var(--white-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #0056b3;
}

.error-message {
    color: var(--error-color);
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
    display: none; /* Hidden by default */
}

/* Language Switcher on Login Page */
.login-form-section {
    position: relative;
}

.login-lang-switcher {
    position: static; /* avoid absolute overlay */
    align-self: flex-end;
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.login-lang-switcher button {
    background-color: transparent;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-color);
    transition: background-color 0.3s, color 0.3s;
}

.login-lang-switcher button.active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-box {
        flex-direction: column;
    }
    .login-promo, .login-form-section {
        width: 100%;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .login-box { margin-top: 10px; }
    .login-promo, .login-form-section { padding: 24px 16px; }
    .login-promo h1 { font-size: 1.8rem; }
    .login-promo p { font-size: 1rem; }
    .features-list li { font-size: 0.95rem; }
    .features-list .fas { width: 20px; margin-right: 10px; }
    .login-form-section h2 { font-size: 1.8rem; }
    .login-form-section .subtitle { font-size: 0.95rem; margin-bottom: 20px; }
    .login-form { max-width: 100%; margin: 0 auto; }
    .login-form input { padding: 10px 12px; font-size: 1rem; }
    .login-btn { padding: 12px; font-size: 1rem; }
    .login-lang-switcher button { padding: 6px 10px; }
}
