/*
 * errors.css — Error states, toast notifications, inline messages
 * widget4 modernization
 */

/* ============================================================
   Network / load error inside sections
   ============================================================ */

.load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 72px;
    padding: 16px;
    border: 1px solid var(--color-error-light);
    border-radius: var(--radius-md);
    background: var(--color-error-light);
    color: var(--btn-bg);
    font-size: 13px;
    text-align: center;
}

.load-error .btn-retry {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--btn-bg);
    border-radius: var(--radius-sm);
    color: var(--btn-bg);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.load-error .btn-retry:hover {
    background: var(--btn-bg);
    color: #fff;
}

/* ============================================================
   Toast notifications (top-center)
   ============================================================ */

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    pointer-events: all;
    animation: slideDown 0.3s ease;
    max-width: 360px;
}

.toast.error   { background: var(--btn-bg);    color: #fff; }
.toast.success { background: var(--color-success); color: #fff; }
.toast.warning { background: var(--color-warning); color: #fff; }
.toast.info    { background: var(--color-info);    color: #fff; }

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-8px); }
}
.toast.removing { animation: toastOut 0.25s ease forwards; }

/* ============================================================
   Form field — improved error state
   ============================================================ */

/* Pulse on first error appearance */
@keyframes fieldErrorIn {
    0%   { border-color: var(--btn-bg); box-shadow: none; }
    50%  { box-shadow: var(--shadow-focus); }
    100% { border-color: var(--btn-bg); box-shadow: none; }
}

input[type="text"].field-error,
input[type="email"].field-error {
    border-color: var(--btn-bg);
    animation: fieldErrorIn 0.4s ease;
}

/* ============================================================
   Alert boxes (replacing native alert())
   ============================================================ */

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin: 8px 0;
    font-size: 13px;
}

.alert-box.error   { background: var(--color-error-light);   color: var(--btn-press); border-left: 3px solid var(--btn-bg); }
.alert-box.success { background: var(--color-success-light);  color: var(--color-success); border-left: 3px solid var(--color-success); }
.alert-box.warning { background: var(--color-warning-light);  color: var(--color-warning); border-left: 3px solid var(--color-warning); }
