/*
 * AP Registry Toast — vlastní namespace, nezávislé na Tailwind builderu tématu.
 * Vzor: existující "toast aktivního vozu" (inc/users/account-garage.php).
 *
 * Struktura DOM (viz registry-toast.js):
 *   .ap-registry-toast (.ap-registry-toast--success|warning|danger)
 *     .ap-registry-toast__stripe
 *     .ap-registry-toast__icon
 *     .ap-registry-toast__body
 *       .ap-registry-toast__label
 *       .ap-registry-toast__title
 *       .ap-registry-toast__message
 *       .ap-registry-toast__question
 *       .ap-registry-toast__actions
 *         .ap-registry-toast__cta
 *     .ap-registry-toast__close
 */

.ap-registry-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    width: calc(100vw - 2rem);
    max-width: 24rem;
    padding: 1rem 1rem 1rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;     /* slate-200 */
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    color: #0f172a;                 /* slate-900 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.45;
}

@media (min-width: 640px) {
    .ap-registry-toast {
        right: 1.5rem;
        bottom: 1.5rem;
    }
}

.ap-registry-toast__stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #475569;
}
.ap-registry-toast--success .ap-registry-toast__stripe { background: #059669; } /* emerald-600 */
.ap-registry-toast--warning .ap-registry-toast__stripe { background: #d97706; } /* amber-600   */
.ap-registry-toast--danger  .ap-registry-toast__stripe { background: #dc2626; } /* red-600     */

.ap-registry-toast__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ap-registry-toast__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ap-registry-toast--success .ap-registry-toast__icon { background: #ecfdf5; color: #059669; } /* emerald-50/600 */
.ap-registry-toast--warning .ap-registry-toast__icon { background: #fffbeb; color: #d97706; } /* amber-50/600   */
.ap-registry-toast--danger  .ap-registry-toast__icon { background: #fef2f2; color: #dc2626; } /* red-50/600     */

.ap-registry-toast__body {
    flex: 1 1 0%;
    min-width: 0;
}

.ap-registry-toast__label {
    margin: 0 0 0.125rem 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;             /* slate-500 */
}

.ap-registry-toast__title {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;             /* slate-900 */
}

.ap-registry-toast__message {
    margin: 0;
    font-size: 0.8125rem;
    color: #334155;             /* slate-700 */
}

.ap-registry-toast__question {
    margin: 0.375rem 0 0 0;
    font-size: 0.75rem;
    color: #64748b;             /* slate-500 */
}

.ap-registry-toast__actions {
    margin-top: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ap-registry-toast__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: #ffffff;
    background: #0f172a;        /* slate-900 default */
    border: 1px solid #0f172a;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.ap-registry-toast__cta:hover,
.ap-registry-toast__cta:focus-visible {
    background: #1e293b;        /* slate-800 */
    border-color: #1e293b;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.24);
    transform: translateY(-1px);
}
.ap-registry-toast__cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

/* CTA barva podle severity toastu — ladí s stripe + icon barvou. */
.ap-registry-toast--success .ap-registry-toast__cta {
    background: #059669; border-color: #059669;             /* emerald-600 */
}
.ap-registry-toast--success .ap-registry-toast__cta:hover,
.ap-registry-toast--success .ap-registry-toast__cta:focus-visible {
    background: #047857; border-color: #047857;             /* emerald-700 */
}
.ap-registry-toast--warning .ap-registry-toast__cta {
    background: #d97706; border-color: #d97706;             /* amber-600 */
}
.ap-registry-toast--warning .ap-registry-toast__cta:hover,
.ap-registry-toast--warning .ap-registry-toast__cta:focus-visible {
    background: #b45309; border-color: #b45309;             /* amber-700 */
}
.ap-registry-toast--danger .ap-registry-toast__cta {
    background: #dc2626; border-color: #dc2626;             /* red-600 */
}
.ap-registry-toast--danger .ap-registry-toast__cta:hover,
.ap-registry-toast--danger .ap-registry-toast__cta:focus-visible {
    background: #b91c1c; border-color: #b91c1c;             /* red-700 */
}

.ap-registry-toast__close {
    flex-shrink: 0;
    margin-left: 0.25rem;
    padding: 0.25rem;
    background: transparent;
    border: 0;
    color: #94a3b8;             /* slate-400 */
    cursor: pointer;
    line-height: 0;
    transition: color 120ms ease;
}
.ap-registry-toast__close:hover,
.ap-registry-toast__close:focus-visible {
    color: #334155;             /* slate-700 */
}
.ap-registry-toast__close svg {
    width: 1rem;
    height: 1rem;
}

/* Neutrální varianta (od 23. 9. 2026, přesun do ap-vin-catalog-helper):
   termín technické neznáme, toast jen nabízí garáž. Proužek a tlačítko
   zůstávají ve výchozí šedé (viz výše), jen ikona dostane podklad. */
.ap-registry-toast--neutral .ap-registry-toast__icon { background: #f1f5f9; color: #475569; } /* slate-100/600 */
