﻿/* ============================================================
   LTG Alert — project-wide notification system
   ============================================================ */

/* Overlay */
.ltg-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

    .ltg-alert-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

/* Card */
.ltg-alert {
    width: 100%;
    max-width: 380px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e7);
    border-radius: var(--r-lg, 16px);
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.1));
    padding: 26px 24px 22px;
    text-align: center;
    transform: scale(0.94);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.ltg-alert-overlay.show .ltg-alert {
    transform: scale(1);
}

/* Icon badge */
.ltg-alert-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}

    .ltg-alert-icon svg {
        width: 26px;
        height: 26px;
        display: block;
    }

/* Variant colours */
.ltg-alert--error .ltg-alert-icon {
    background: rgba(215, 0, 21, 0.10);
    color: var(--danger, #d70015);
}

.ltg-alert--success .ltg-alert-icon {
    background: rgba(52, 199, 89, 0.12);
    color: #248a3d;
}

.ltg-alert--info .ltg-alert-icon {
    background: rgba(63, 118, 82, 0.12);
    color: var(--accent, #3F7652);
}

.ltg-alert--warning .ltg-alert-icon {
    background: rgba(255, 179, 0, 0.14);
    color: #b45309;
}

.ltg-alert-overlay.dark-theme .ltg-alert--error .ltg-alert-icon,
:root.dark-theme .ltg-alert--error .ltg-alert-icon {
    background: rgba(255, 69, 58, 0.15);
    color: var(--danger, #ff453a);
}

:root.dark-theme .ltg-alert--success .ltg-alert-icon {
    background: rgba(52, 199, 89, 0.18);
    color: #52d97a;
}

:root.dark-theme .ltg-alert--warning .ltg-alert-icon {
    background: rgba(255, 179, 0, 0.18);
    color: #fbbf24;
}

/* Title & message */
.ltg-alert-title {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text, #1d1d1f);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.ltg-alert-message {
    margin: 0 0 20px 0;
    font-size: 13.5px;
    color: var(--text-2, #6e6e73);
    line-height: 1.5;
    word-break: break-word;
}

/* Actions */
.ltg-alert-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: auto;
}

.ltg-alert-btn {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--r-sm, 8px);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    font-family: inherit;
    line-height: 1;
}

    .ltg-alert-btn:active {
        transform: scale(0.97);
    }

.ltg-alert-btn--primary {
    background: var(--accent, #3F7652);
    color: #fff;
    border-color: var(--accent, #3F7652);
}

    .ltg-alert-btn--primary:hover {
        background: var(--accent-hover, #2e5a3e);
        border-color: var(--accent-hover, #2e5a3e);
    }

.ltg-alert-btn--danger {
    background: var(--danger, #d70015);
    color: #fff;
    border-color: var(--danger, #d70015);
}

    .ltg-alert-btn--danger:hover {
        background: #b80012;
        border-color: #b80012;
    }

.ltg-alert-btn--secondary {
    background: var(--surface-2, #f5f5f7);
    color: var(--text, #1d1d1f);
    border-color: var(--border, #e5e5e7);
}

    .ltg-alert-btn--secondary:hover {
        background: var(--surface-3, #ececee);
        border-color: var(--border-2, #d2d2d7);
    }

/* Mobile */
@media (max-width: 480px) {
    .ltg-alert-overlay {
        padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
        align-items: center;
    }

    .ltg-alert {
        max-width: 100%;
        padding: 22px 20px 18px;
        border-radius: var(--r-lg, 16px);
    }

    .ltg-alert-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

        .ltg-alert-icon svg {
            width: 22px;
            height: 22px;
        }

    .ltg-alert-title {
        font-size: 16px;
    }

    .ltg-alert-message {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .ltg-alert-btn {
        height: 44px;
        font-size: 14.5px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ltg-alert-overlay,
    .ltg-alert {
        transition: none;
    }
}
