.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal-content {
    background-color: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

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

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.auth-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d2d2d;
    margin: 0;
}

.auth-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #8e8e8e;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background-color: #f4f4f4;
    color: #2d2;
}

.auth-modal-body {
    overflow-y: auto;
    padding: 24px;
    flex: 1;
}

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

.auth-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #2d2d2d;
    margin-bottom: 8px;
}

.auth-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #a9a9a9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.auth-form-group input:focus {
    border-color: #667eea;
    outline: none;
}

.auth-forgot {
    text-align: right;
    margin-bottom: 20px;
}

.auth-forgot a {
    font-size: 13px;
    color: #0273a8;
    text-decoration: none;
}

.auth-forgot a:hover {
    text-decoration: underline;
}

.auth-btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #0273a8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.auth-btn-primary:hover {
    opacity: 0.9;
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6e6e6e;
}

.auth-switch a {
    color: #0273a8;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.auth-alert-success {
    background-color: rgba(198, 233, 198, 1);
    color: rgba(31, 142, 31, 1);
    border: 1px solid #cfc;
}

/* Стили для чекбокса */
.auth-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0273a8d4;
    flex-shrink: 0;
}

.auth-checkbox-label span {
    font-size: 14px;
    color: #2d2d2d;
    line-height: 1.5;
}

.auth-checkbox-label a {
    color: #0273a8;
    text-decoration: none;
}

.auth-checkbox-label a:hover {
    text-decoration: underline;
}

/* Кнопки входа/регистрации в хедере */
.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-login,
.btn-register {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-login {
    background-color: #0273a8;
    color: white;
}

.btn-login:hover {
    opacity: 0.9;;
}

.btn-register {
    background-color: #0273a8;
    color: white;
}

.btn-register:hover {
    opacity: 0.9;
}

.social-auth-btn {
    display: grid;
    grid-template-columns: 24px 190px;
    align-items: center;
    justify-content: center;
    column-gap: 12px;
    width: 100%;
    padding: 11px 8px 11px 32px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #3c4043;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    margin-top: 10px;
    line-height: 1.2;
}

.social-auth-btn:first-of-type {
    margin-top: 14px;
}

.social-auth-btn:hover {
    background: #f8f9fa;
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.social-auth-btn:active {
    background: #ededed;
}

.social-auth-icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.social-auth-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.social-auth-text {
    display: block;
    text-align: left;
}

body[data-theme="dark"] .auth-modal-overlay {
    background-color: rgba(0, 0, 0, 0.72);
}

body[data-theme="dark"] .auth-modal-content {
    background: #20242c;
    border: 1px solid #333b48;
    color: #e5e7eb;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

body[data-theme="dark"] .auth-modal-header {
    border-bottom-color: #333b48;
}

body[data-theme="dark"] .auth-modal-header h3 {
    color: #f3f4f6;
}

body[data-theme="dark"] .auth-modal-close {
    color: #c5cedb;
}

body[data-theme="dark"] .auth-modal-close:hover {
    background-color: #303845;
    color: #ffffff;
}

body[data-theme="dark"] .auth-modal-body {
    background: #20242c;
}

body[data-theme="dark"] .auth-form-group label,
body[data-theme="dark"] .auth-checkbox-label span {
    color: #d6deea;
}

body[data-theme="dark"] .auth-form-group input {
    background: #151922;
    border-color: #374151;
    color: #f3f4f6;
}

body[data-theme="dark"] .auth-form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

body[data-theme="dark"] .auth-form-group input::placeholder {
    color: #8c98aa;
}

body[data-theme="dark"] .auth-forgot a,
body[data-theme="dark"] .auth-switch a,
body[data-theme="dark"] .auth-checkbox-label a {
    color: #93c5fd;
}

body[data-theme="dark"] .auth-switch,
body[data-theme="dark"] .auth-modal-body p[style*="color"] {
    color: #c5cedb !important;
}

body[data-theme="dark"] .auth-btn-primary {
    background-color: #0273a8;
    color: #ffffff;
}

body[data-theme="dark"] .auth-btn-primary:hover {
    background-color: #0584bf;
    opacity: 1;
}

body[data-theme="dark"] .auth-alert-error {
    background-color: rgba(127, 29, 29, 0.22);
    border-color: rgba(248, 113, 113, 0.38);
    color: #fecaca;
}

body[data-theme="dark"] .auth-alert-success {
    background-color: rgba(20, 83, 45, 0.26);
    border-color: rgba(74, 222, 128, 0.36);
    color: #bbf7d0;
}

body[data-theme="dark"] .yandex-auth-divider {
    color: #9ca3af !important;
}

body[data-theme="dark"] .yandex-auth-divider span[style*="background"] {
    background: #374151 !important;
}

body[data-theme="dark"] .social-auth-btn {
    background: #151922;
    border-color: #374151;
    color: #e5e7eb;
    box-shadow: none;
}

body[data-theme="dark"] .social-auth-btn:hover {
    background: #26303d;
    border-color: #4b5563;
    color: #ffffff;
    box-shadow: none;
}

body[data-theme="dark"] .social-auth-btn:active {
    background: #1f2937;
}

@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .btn-login,
    .btn-register {
        padding: 8px;
        font-size: 14px;
    }
}

