:root {
    --primary: #3498DB;
    --primary-dark: #2980B9;
    --primary-light: #5DADE2;
    --secondary: #2980B9;
    --secondary-dark: #1F618D;
    --accent: #6BFFD8;
    --accent-dark: #4AE6C3;
    --success: #2ED16C;
    --warning: #FFB84A;
    --danger: #FF4A6B;
    --dark: #2A2D43;
    --dark-light: #3A3F5A;
    --light: #F8FAFF;
    --gray: #A0A7C2;
    --gray-light: #E6E9F5;

    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, #FF8B6B 100%);
    --gradient-hero: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 40%, var(--secondary) 100%);

    --shadow: 0 8px 20px rgba(52, 152, 219, 0.15);
    --shadow-hover: 0 12px 30px rgba(52, 152, 219, 0.25);
    --shadow-card: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 10px 25px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-wrapper {
    display: flex;
    width: 100%;
    box-shadow: var(--shadow-card-hover);
    min-height: 550px;
    max-width: 1000px;
    width: 100%;
}


/* Лява колона с градиент и информация */
.login-side {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    order: 1;
    /* Default desktop order: Left side */
}

.login-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.login-side-content {
    position: relative;
    z-index: 2;
}

.login-side h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.login-side p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.features-list {
    list-style: none;
    margin-top: 30px;
    padding-left: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 18px;
    flex-shrink: 0;
    /* Prevent icon shrinking */
}

/* Дясна колона с формата */
.login-form-side {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    order: 2;
    /* Default desktop order: Right side */
}

.login-header {
    margin-bottom: 40px;
}

.login-header h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--gray);
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.form-control {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control::placeholder {
    color: var(--gray);
}

/* Подобрени бутони */
.btn-login {
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    width: 100%;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
    color: white;
}

/* Опции под формата */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Разделител */
.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
    color: var(--gray);
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-light);
    z-index: 1;
}

.divider span {
    background: white;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

/* Социални бутони */
.social-login {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.social-btn {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    border: 2px solid var(--gray-light);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    color: var(--dark);
    text-decoration: none;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    text-decoration: none;
}

.social-btn.facebook {
    color: #1877F2;
}

.social-btn.google {
    color: #DB4437;
}

/* Регистрация връзка */
.register-link {
    text-align: center;
    margin-top: 25px;
    color: var(--gray);
    font-size: 14px;
}

.register-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.register-link a:hover {
    text-decoration: underline;
}


/* Адаптивен дизайн */
@media (max-width: 900px) {
    .login-wrapper {
        flex-direction: column;
        max-width: 600px;
    }

    .login-side {
        padding: 40px 30px;
        order: 2;
        /* Move text BELOW form on mobile */
    }

    .login-form-side {
        padding: 40px 30px;
        order: 1;
        /* Move form to TOP on mobile */
    }

    .login-side h2 {
        font-size: 1.8rem;
    }

    .social-login {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .login-side h2 {
        font-size: 1.6rem;
    }

    .login-header h2 {
        font-size: 1.7rem;
    }

    .features-list li {
        font-size: 14px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .login-container {
        padding: 20px 15px;
    }

    /* Hide text on back button for small screens */
    .user-actions .btn-outline {
        padding: 10px;
        font-size: 0;
        /* Hide text */
        display: flex;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
    }

    .user-actions .btn-outline i {
        font-size: 16px;
        /* Restore icon size */
        margin-right: 0;
    }
}

/* Validation & Utility Classes (replacing missing Bootstrap) */
.text-danger {
    color: var(--danger) !important;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

.field-validation-error {
    color: var(--danger) !important;
}

.validation-summary-errors {
    color: var(--danger) !important;
    background-color: rgba(255, 74, 107, 0.1);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.validation-summary-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.d-flex {
    display: flex !important;
}

.gap-3 {
    gap: 1rem !important;
}

.text-center {
    text-align: center !important;
}

.text-muted {
    color: var(--gray) !important;
}

.small {
    font-size: 0.875rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-5 {
    margin-top: 3rem !important;
}

/* Футър - същият като основната страница */
footer {
    margin-top: auto;
    background: var(--dark);
    color: white;
    padding: 30px 0 20px;
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-minimal {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-identity {
    flex: 1;
    max-width: 480px;
}

.footer-description {
    color: var(--gray);
    font-size: 15px;
    line-height: 1.6;
    margin-top: 15px;
}

.footer-reach {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

.footer-contact-minimal {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-contact-minimal a {
    color: var(--gray);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.footer-contact-minimal a:hover {
    color: white;
}

.footer-contact-minimal i {
    color: var(--primary);
    font-size: 14px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 28px;
    color: white;
    letter-spacing: -0.5px;
}

/* Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-main {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo-tagline {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    transform: rotate(-5deg);
}

.logo i {
    color: white;
    font-size: 24px;
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.social-icon:hover {
    background: var(--secondary-dark);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-size: 13px;
}

@media (max-width: 768px) {
    .footer-minimal {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    .footer-reach {
        align-items: center;
    }

    .footer-contact-minimal a {
        justify-content: center;
    }
}

@media (max-width: 576px) and (orientation: portrait) {
    .footer-logo {
        justify-content: center;
    }
}

/* Navigation Link (Back to Home) */
.nav-link {
    text-decoration: none;
    color: #1e3a8a;
    /* Match Home nav color */
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    /* Needed for ::after absolute positioning */
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}