@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@700;800;900&display=swap');

:root {
    --bg: #171820;
    --card: rgba(255, 255, 255, 0.085);
    --border: rgba(255, 255, 255, 0.14);

    --white: #ffffff;
    --text-soft: #c8cbd4;
    --muted: #9da3ad;

    --green: #22d36f;
    --green-2: #18bf63;
    --green-dark: #12a85a;
    --green-soft: #86efac;
    --green-glow: rgba(34, 211, 111, 0.32);

    --shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
    --radius: 32px;

    --font-title: "Outfit", sans-serif;
    --font-body: "Manrope", sans-serif;
}

/* ================= RESET ================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    min-height: 100dvh;
    font-family: var(--font-body);
    color: var(--white);
    background:
        radial-gradient(circle at 12% 10%, rgba(34, 211, 111, 0.24), transparent 30rem),
        radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.08), transparent 30rem),
        radial-gradient(circle at 50% 100%, rgba(34, 211, 111, 0.10), transparent 34rem),
        var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
    z-index: 0;
}

/* ================= CONTENEDOR ================= */

.error-page {
    width: 100%;
    min-height: 100dvh;
    padding: clamp(18px, 4vh, 42px) clamp(14px, 4vw, 34px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ================= GLOWS ================= */

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(85px);
    pointer-events: none;
    z-index: 1;
}

.glow-blue {
    width: 360px;
    height: 360px;
    background: rgba(34, 211, 111, 0.30);
    top: 8%;
    left: -120px;
}

.glow-purple {
    width: 380px;
    height: 380px;
    background: rgba(34, 211, 111, 0.14);
    right: -130px;
    bottom: 8%;
}

/* ================= TARJETA ================= */

.error-card {
    width: min(720px, 100%);
    position: relative;
    z-index: 2;
    text-align: center;
    padding: clamp(2rem, 4vw, 3.4rem);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 211, 111, 0.16), transparent 22rem),
        linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.045));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    overflow: hidden;
}

.error-card::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    top: -125px;
    right: -110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 111, 0.30), transparent 70%);
    filter: blur(8px);
    pointer-events: none;
    z-index: 0;
}

.error-card::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    left: -105px;
    bottom: -115px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 111, 0.16), transparent 70%);
    filter: blur(8px);
    pointer-events: none;
    z-index: 0;
}

/* ================= ICONO ================= */

.error-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: white;
    font-size: 2.15rem;
    box-shadow: 0 18px 45px rgba(34, 211, 111, 0.34);
    position: relative;
    z-index: 2;
}

/* ================= IMAGEN OPCIONAL ================= */

.error-image-box {
    width: min(220px, 60%);
    margin: 0 auto 1.35rem;
    position: relative;
    z-index: 2;
}

.error-image {
    width: 100%;
    display: block;
    filter: drop-shadow(0 18px 34px rgba(0,0,0,0.38));
}

/* ================= ETIQUETA ================= */

.error-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: rgba(34, 211, 111, 0.13);
    border: 1px solid rgba(34, 211, 111, 0.30);
    color: var(--green-soft);
    font-family: var(--font-title);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

/* ================= TÍTULO ================= */

h1 {
    max-width: 650px;
    margin-inline: auto;
    font-family: var(--font-title);
    font-size: clamp(2.4rem, 4.7vw, 4rem);
    font-weight: 900;
    line-height: 0.96;
    letter-spacing: -0.045em;
    color: var(--white);
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

/* ================= MENSAJE ================= */

.error-message {
    max-width: 590px;
    margin: 0 auto 1.6rem;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* ================= BOTONES ================= */

.error-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
}

.back-button {
    min-height: 54px;
    padding: 0 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--green-dark), var(--green)) !important;
    color: white !important;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 900;
    box-shadow: 0 18px 40px rgba(34, 211, 111, 0.30);
    transition: 0.28s ease;
    position: relative;
    z-index: 6;
    white-space: nowrap;
    border: 0;
}

.back-button:hover {
    transform: translateY(-4px);
    color: white !important;
    box-shadow: 0 26px 58px rgba(34, 211, 111, 0.42);
}

/* Segundo botón sin rosado */
.secondary-access-button {
    background: rgba(34, 211, 111, 0.12) !important;
    color: var(--green-soft) !important;
    border: 1px solid rgba(34, 211, 111, 0.34) !important;
    box-shadow: none !important;
}

.secondary-access-button:hover {
    background: rgba(34, 211, 111, 0.18) !important;
    color: white !important;
    border-color: rgba(34, 211, 111, 0.55) !important;
    box-shadow: 0 20px 45px rgba(34, 211, 111, 0.18) !important;
}

/* Botón secundario opcional */
.secondary-button {
    min-height: 54px;
    padding: 0 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border-radius: 999px;
    background: rgba(34, 211, 111, 0.10);
    color: var(--green-soft);
    border: 1px solid rgba(34, 211, 111, 0.30);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 900;
    transition: 0.28s ease;
    position: relative;
    z-index: 6;
    white-space: nowrap;
}

.secondary-button:hover {
    transform: translateY(-4px);
    color: var(--white);
    border-color: rgba(34, 211, 111, 0.50);
    background: rgba(34, 211, 111, 0.16);
}

/* ================= COUNTDOWN ================= */

.countdown-box {
    margin: 1.4rem auto 0;
    width: max-content;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(34, 211, 111, 0.10);
    border: 1px solid rgba(34, 211, 111, 0.20);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.18);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex: 0 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================= TABLET ================= */

@media (max-width: 768px) {
    .error-card {
        width: min(620px, 100%);
        padding: 2.2rem 1.5rem;
    }

    .error-image-box {
        width: min(210px, 68%);
    }

    h1 {
        font-size: clamp(2.25rem, 8vw, 3.5rem);
    }

    .error-message {
        font-size: 0.98rem;
    }
}

/* ================= CELULAR ================= */

@media (max-width: 575px) {
    body {
        background:
            radial-gradient(circle at 20% 0%, rgba(34, 211, 111, 0.26), transparent 18rem),
            radial-gradient(circle at 100% 20%, rgba(34, 211, 111, 0.12), transparent 18rem),
            var(--bg);
    }

    body::before {
        background-size: 52px 52px;
        opacity: 0.55;
    }

    .error-page {
        min-height: 100dvh;
        padding: 16px 12px;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    .bg-glow {
        filter: blur(70px);
        opacity: 0.75;
    }

    .glow-blue {
        width: 240px;
        height: 240px;
        top: -40px;
        left: -90px;
    }

    .glow-purple {
        width: 250px;
        height: 250px;
        right: -120px;
        bottom: -60px;
    }

    .error-card {
        width: 100%;
        max-width: 420px;
        min-height: auto;
        padding: 1.8rem 1.15rem;
        border-radius: 28px;
        display: block;
    }

    .error-card::before {
        width: 220px;
        height: 220px;
        top: -110px;
        right: -100px;
    }

    .error-card::after {
        width: 190px;
        height: 190px;
        left: -95px;
        bottom: -95px;
    }

    .error-icon {
        width: 68px;
        height: 68px;
        font-size: 1.9rem;
        border-radius: 22px;
        margin-bottom: 1rem;
    }

    .error-image-box {
        width: min(185px, 70%);
        margin-bottom: 1.1rem;
    }

    .error-label {
        font-size: 0.66rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 0.9rem;
        letter-spacing: 0.07em;
    }

    h1 {
        font-size: clamp(2rem, 10vw, 2.75rem);
        line-height: 0.97;
        letter-spacing: -0.04em;
        margin-bottom: 0.9rem;
    }

    .error-message {
        max-width: 100%;
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }

    .error-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .back-button,
    .secondary-button {
        width: 100%;
        min-height: 52px;
        font-size: 0.96rem;
        padding: 0 1rem;
    }

    .countdown-box {
        width: 100%;
        justify-content: center;
        text-align: center;
        border-radius: 18px;
        padding: 0.85rem 0.9rem;
        font-size: 0.86rem;
    }
}

/* ================= CELULAR MUY PEQUEÑO ================= */

@media (max-width: 380px) {
    .error-card {
        padding: 1.5rem 1rem;
        border-radius: 24px;
    }

    .error-icon {
        width: 62px;
        height: 62px;
        font-size: 1.75rem;
    }

    .error-image-box {
        width: min(160px, 68%);
    }

    h1 {
        font-size: clamp(1.85rem, 10vw, 2.35rem);
    }

    .error-message {
        font-size: 0.88rem;
    }

    .back-button,
    .secondary-button {
        min-height: 50px;
        font-size: 0.9rem;
    }

    .countdown-box {
        font-size: 0.8rem;
    }
}