.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    border-top: 5px solid #2ecc71;
    animation: slideDown 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    margin: 15px 0 25px;
    color: #2c3e50;
    font-size: 26px;
    font-weight: 800;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.2);
}

.login-submit {
    width: 100%;
    padding: 14px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    margin-top: 10px;
}

.login-submit:hover {
    background: #27ae60;
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(1px);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #bbb;
    transition: color 0.3s, transform 0.3s;
}

.close-modal:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.reg-link {
    margin-top: 25px;
    font-size: 14px;
    color: #7f8c8d;
}

.reg-link a {
    color: #2ecc71;
    text-decoration: none;
    font-weight: 600;
}

.reg-link a:hover {
    text-decoration: underline;
}

.user-profile-container {
    position: relative;
    cursor: pointer;
}

.user-name-trigger {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2c3e50;
    text-decoration: none;
    position: relative;
    padding: 5px 0; /* Совпадает с .menu a */
    transition: color 0.3s ease;
    display: inline-block;
}

.user-name-trigger::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #2ecc71;
    border-radius: 2px;
    transition: width 0.3s ease;
}


.user-name-trigger:hover {
    color: #2ecc71;
    border-bottom: none; /* Убираем старое подчеркивание, если оно было */
}

.user-name-trigger:hover::after {
    width: 100%;
}

.user-profile-container {
    margin-left: 0; /* Убираем лишний отступ, за него теперь отвечает .menu gap */
    display: inline-block;
}

/* Выпадающее меню */
.profile-dropdown {
    display: none; /* Скрыто по умолчанию */
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 15px;
    z-index: 1000;
    margin-top: 10px;
    border: 1px solid #eee;
}

.dropdown-header {
    text-align: left;
    margin-bottom: 10px;
}

#dropdownUserName {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

.role-badge {
    font-size: 10px;
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    color: #7f8c8d;
    text-transform: uppercase;
}

.profile-dropdown hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 10px 0;
}

.dropdown-item {
    display: block;
    padding: 8px 0;
    color: #34495e;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.dropdown-item:hover {
    color: #2ecc71;
}

.logout-item {
    color: #e74c3c !important;
    font-weight: bold;
}

.error-message {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    padding: 10px;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 15px;
    display: none; /* Скрыто по умолчанию */
    border: 1px solid rgba(231, 76, 60, 0.2);
    text-align: center;
}