/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text);
}

.modal-close:hover {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius);
    color: white;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    font-size: 14px;
    font-weight: 500;
}

.notification.success { background: var(--dark); border-left: 3px solid var(--accent); }
.notification.error { background: #DC2626; }
.notification.info { background: var(--dark); }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* ===== ОВЕРЛЕЙ УСПЕХА ===== */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 9, 11, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-card {
    background: var(--white);
    padding: 48px 56px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 420px;
    width: 90%;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-overlay.active .success-card {
    transform: translateY(0) scale(1);
}

/* Анимированная галочка */
.success-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
}

.success-checkmark {
    width: 88px;
    height: 88px;
}

.success-circle {
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-linecap: round;
}

.success-check {
    stroke: var(--accent);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
}

.success-overlay.active .success-circle {
    animation: success-circle-anim 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-overlay.active .success-check {
    animation: success-check-anim 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes success-circle-anim {
    from { stroke-dashoffset: 166; }
    to { stroke-dashoffset: 0; }
}

@keyframes success-check-anim {
    from { stroke-dashoffset: 48; }
    to { stroke-dashoffset: 0; }
}

.success-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(10px);
}

.success-text {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    opacity: 0;
    transform: translateY(10px);
}

.success-overlay.active .success-title {
    animation: success-text-anim 0.5s ease 0.9s forwards;
}

.success-overlay.active .success-text {
    animation: success-text-anim 0.5s ease 1.1s forwards;
}

@keyframes success-text-anim {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}