* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
    position: relative;
}

body::before {
    content: none;
}

.toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: min(420px, calc(100vw - 32px));
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(217, 226, 240, 0.92);
    border-left: 5px solid var(--primary);
    border-radius: 18px;
    box-shadow: 0 22px 48px rgba(7, 37, 86, 0.18);
    padding: 14px 16px 14px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--accent);
}

.toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex: 0 0 auto;
    background: rgba(20, 63, 134, 0.1);
    color: var(--primary-dark);
}

.toast.success .toast-icon {
    background: rgba(6, 118, 71, 0.12);
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.toast.warning .toast-icon {
    background: rgba(246, 197, 70, 0.2);
    color: #9a6b00;
}

.toast-body {
    min-width: 0;
    flex: 1 1 auto;
}

.toast-title {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 3px;
}

.toast-message {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.toast-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex: 0 0 auto;
}

.toast-close:hover {
    background: rgba(20, 63, 134, 0.08);
    color: var(--primary-dark);
}

/* TOPBAR */

.topbar {
    min-height: 74px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 248, 0.98));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 10px 22px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 8px 22px rgba(15, 37, 77, 0.04);
}

.topbar::before {
    content: none;
}

.brand-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.brand-link:hover {
    opacity: 0.96;
    transform: none;
}

.brand-link:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.26);
    outline-offset: 6px;
    border-radius: 14px;
}

.brand-side {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 0;
}

.brand-side-image {
    display: block;
    width: auto;
    object-fit: contain;
}

.brand-side-image-pensar {
    height: 42px;
    max-width: min(24vw, 220px);
}

.brand-side-image-proposito {
    height: 40px;
    max-width: min(20vw, 170px);
}

.brand-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
}

.brand-center strong {
    display: block;
    font-size: 25px;
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--primary-dark);
}

.brand-center span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.015em;
    margin-top: 2px;
}

.topbar-right,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: flex-end;
}

.topbar .btn-light {
    background: #ffffff;
    border-color: var(--border);
    color: var(--primary-dark);
}

.topbar .btn-light:hover {
    background: var(--surface-soft);
}

.topbar .btn-secondary {
    background: #f8fbff;
    border-color: var(--border);
    color: var(--primary-dark);
}

.brand-divider {
    width: 1px;
    height: 42px;
    background: linear-gradient(180deg, rgba(215, 162, 51, 0.08), rgba(215, 162, 51, 0.48), rgba(215, 162, 51, 0.08));
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo-image {
    display: block;
    width: auto;
    height: 58px;
    max-width: min(22vw, 220px);
    object-fit: contain;
}

.brand-text strong {
    display: block;
    font-size: 19px;
    color: var(--primary-dark);
}

.brand-text span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

@media (max-width: 900px) {
    .topbar {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 16px 18px;
        gap: 14px;
    }

    .topbar-right,
    .topbar-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .brand-side-image-pensar {
        height: 42px;
    }

    .brand-side-image-proposito {
        height: 40px;
    }

    .brand-center strong {
        font-size: 24px;
    }
}
