/* ============================================================
   Error pages (403 / 404 / 500).

   Loaded globally from base.html.twig rather than inlined into each error
   template's {% block stylesheets %}.

   Why: Unpoly swaps body fragments and never touches <head>. When a request
   made by Unpoly failed, the error markup was rendered into the page while its
   <style> block — which lived in <head> — was silently dropped, so the error
   page arrived completely unstyled. Keeping these rules in an always-present
   stylesheet means a fragment-rendered error still looks right.
   ============================================================ */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 65vh;
    text-align: center;
    padding: 2rem 1.5rem;
}

.error-badge {
    width: 160px;
    height: 160px;
    margin: 0 auto 2rem;
    position: relative;
}

.error-badge-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.error-badge-icon {
    font-size: 4.5rem;
}

.error-code {
    font-size: 5rem;
    font-weight: 800;
    color: #1A2E42;
    line-height: 1;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}

.error-headline {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1A2E42;
    margin-bottom: 0.75rem;
}

.error-message {
    font-size: 1rem;
    color: #3D5A72;
    max-width: 440px;
    line-height: 1.6;
    margin: 0 auto 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.error-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.error-actions a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.error-btn-primary { background: #1A2E42; color: #fff; }
.error-btn-primary:hover { background: #243d56; color: #fff; }

.error-btn-secondary { background: #EEF0F8; color: #1A2E42; }
.error-btn-secondary:hover { background: #DFE2F2; color: #1A2E42; }

.error-footer-note {
    margin-top: 2.5rem;
    font-size: 0.82rem;
    color: #8AA4B8;
}

.error-footer-note a { color: #3D5A72; }

/* ── Per-status badge treatments ── */

/* 500 — spilled punch */
.error-badge-circle--500 { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); }
.error-badge-circle--500 .error-badge-icon {
    color: #e67e22;
    animation: error-spin-slow 4s ease-in-out infinite;
}

/* 404 — lost */
.error-badge-circle--404 { background: linear-gradient(135deg, #e8f0fe 0%, #d5e3f7 100%); }
.error-badge-circle--404 .error-badge-icon {
    color: #3D5A72;
    animation: error-float 3s ease-in-out infinite;
}

/* 403 — not on the list */
.error-badge-circle--403 { background: linear-gradient(135deg, #fde8e8 0%, #fcd5ce 100%); }
.error-badge-circle--403 .error-badge-icon {
    color: #c0392b;
    animation: error-wiggle 2.5s ease-in-out infinite;
}

.error-badge-slash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 130px;
    height: 6px;
    background: #c0392b;
    border-radius: 3px;
    transform: translate(-50%, -50%) rotate(-45deg);
    opacity: 0.7;
}

@keyframes error-spin-slow {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(15deg); }
    50%  { transform: rotate(0deg); }
    75%  { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

@keyframes error-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

@keyframes error-wiggle {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(-8deg); }
    30%      { transform: rotate(6deg); }
    45%      { transform: rotate(-4deg); }
    60%      { transform: rotate(2deg); }
    75%      { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .error-badge-icon { animation: none !important; }
}
