/* 404 page – sticky footer + modern design */

/* Mobile: no horizontal scroll – maksimalus plotis kaip device */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Container padding mobilui – kad turinys neliestų ekrano kraštų (form-container turi lost-form-shell su savo padding) */
@media (max-width: 767px) {
    body.page-sticky-footer .site-main > .container {
        padding-left: 16px;
        padding-right: 16px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Main fills viewport, footer sticks to bottom */
body.page-404 {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

body.page-404 #main.site-main,
body.page-404 .site-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.page-404 .page-404 {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 24px) clamp(48px, 8vw, 80px);
    min-height: 0;
    background: linear-gradient(180deg, rgba(11, 34, 54, 0.02) 0%, transparent 50%);
}

body.page-404 .site-footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* Content design */
.page-404__inner {
    text-align: center;
    max-width: 440px;
}

.page-404__code {
    font-size: clamp(80px, 20vw, 160px);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.05em;
    color: #0b2236;
    opacity: 0.07;
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
    margin-bottom: -0.12em;
    user-select: none;
}

.page-404__title {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    color: #0b2236;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.page-404__lead {
    font-size: 16px;
    line-height: 1.65;
    color: #64748b;
    margin: 0 0 32px;
}

.page-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.page-404__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

.page-404__btn:hover,
.page-404__btn:focus-visible {
    transform: translateY(-1px);
}

.page-404__btn--primary {
    background: linear-gradient(180deg, #16354d, #0b2236);
    border: 1px solid #0b2236;
    color: #fff;
    box-shadow: 0 2px 8px rgba(11, 34, 54, 0.2);
}

.page-404__btn--primary:hover,
.page-404__btn--primary:focus-visible {
    background: linear-gradient(180deg, #1d3f58, #123046);
    border-color: #153650;
    color: #fff;
    box-shadow: 0 4px 12px rgba(11, 34, 54, 0.25);
}

.page-404__btn--secondary {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #0b2236;
}

.page-404__btn--secondary:hover,
.page-404__btn--secondary:focus-visible {
    border-color: #94a3b8;
    background: #f8fafc;
}

/* Sticky footer – visiems puslapiams, footer visada apačioj */
body.page-sticky-footer {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
/* Sticky header – scroll-padding kad content neslėptųsi po headeriu */
html {
    scroll-padding-top: 70px;
}

body.page-sticky-footer #main.site-main,
body.page-sticky-footer main.site-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: auto;
    min-width: 0; /* flex child – leidžia susitraukti, neperplūsti */
    overflow-x: hidden;
}
/* Content wrappers – trumpam contentui užpildo vietą, ilgam – auga su turiniu */
body.page-sticky-footer .site-main > .container,
body.page-sticky-footer .site-main > main.container,
body.page-sticky-footer .site-main > .form-container,
body.page-sticky-footer .site-main > .page-404,
body.page-sticky-footer .site-main .rc-success,
body.page-sticky-footer .site-main .rc-cancel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: auto; /* neperima ant footer – content nustato aukštį */
    min-width: 0;
    /* Neperrašyti .container max-width – kaip home (1200px), ne full-bleed */
    max-width: min(100%, var(--rs-container, 1200px));
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}
/* Ilgos formos (lost-account) – content iš viršaus, necentruojamas */
body.page-sticky-footer .site-main > .form-container {
    align-items: stretch;
    justify-content: flex-start;
}
/* Minimal content – centruoti vertikaliai (success, cancel, 404) */
body.page-sticky-footer .site-main .rc-success,
body.page-sticky-footer .site-main .rc-cancel,
body.page-sticky-footer .site-main > main.container,
body.page-sticky-footer .site-main > .page-404 {
    justify-content: center;
}
body.page-sticky-footer .site-footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* Subscription success page overrides */
.page-sub-success .page-sub-success__icon {
    font-size: clamp(48px, 12vw, 80px);
    color: #16a34a;
    opacity: 1;
    margin-bottom: 8px;
}
.page-sub-success__redirect {
    margin-top: 24px;
    font-size: 14px;
    color: #64748b;
}
