/* ================================================================
   Westinghouse generator safety and welcome overlays
   Every selector is scoped to its custom element.
   ================================================================ */

generator-safety-gate,
westinghouse-welcome {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: block;
    box-sizing: border-box;
}

generator-safety-gate *,
generator-safety-gate *::before,
generator-safety-gate *::after,
westinghouse-welcome *,
westinghouse-welcome *::before,
westinghouse-welcome *::after {
    box-sizing: border-box;
}

generator-safety-gate[hidden],
westinghouse-welcome[hidden] {
    display: none !important;
}

/* ======================== Safety warning ======================== */

generator-safety-gate {
    color: #202737;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}

generator-safety-gate .gs-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(8px, 2vmin, 22px);
    overflow: hidden;
    background: rgba(13, 20, 32, 0.74);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

generator-safety-gate .gs-panel {
    position: relative;
    width: min(695px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    overflow: hidden;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 24px 75px rgba(0, 0, 0, 0.38);
}

generator-safety-gate .gs-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 1;
    height: 7px;
    border-radius: 13px 13px 0 0;
    background: #ec5d35;
}

generator-safety-gate #gs-form {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    margin: 0;
}

generator-safety-gate .gs-content {
    min-height: 0;
    padding:
        clamp(16px, 3vh, 31px)
        clamp(16px, 3vw, 27px)
        clamp(14px, 2.5vh, 22px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

generator-safety-gate .gs-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

generator-safety-gate .gs-icon {
    display: grid;
    width: clamp(38px, 6vh, 48px);
    height: clamp(38px, 6vh, 48px);
    margin-bottom: clamp(7px, 1.5vh, 13px);
    place-items: center;
    border-radius: 50%;
    color: #4c3a12;
    background: #f9b62f;
}

generator-safety-gate .gs-icon svg {
    width: clamp(20px, 3.5vh, 25px);
    height: clamp(20px, 3.5vh, 25px);
}

generator-safety-gate .gs-kicker {
    margin: 0 0 clamp(3px, 0.7vh, 5px);
    color: #d94e2a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

generator-safety-gate .gs-title {
    margin: 0 0 clamp(6px, 1.2vh, 11px);
    color: #1d2432;
    font-size: clamp(24px, 4.2vmin, 37px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.04;
}

generator-safety-gate .gs-intro {
    margin: 0 0 clamp(8px, 1.8vh, 15px);
    color: #454c59;
    font-size: clamp(13px, 1.8vmin, 15px);
    line-height: 1.4;
}

generator-safety-gate .gs-rules {
    display: grid;
    gap: clamp(5px, 1.2vh, 10px);
    margin: 0 0 clamp(8px, 1.7vh, 14px);
    padding: clamp(9px, 1.7vh, 14px);
    border-radius: 9px;
    background: #f1f3f6;
}

generator-safety-gate .gs-rules-image {
    display: block;
    width: 100%;
    height: auto;
    grid-column: 1 / -1;
    border-radius: 6px;
}

generator-safety-gate .gs-emergency {
    margin: 0 0 clamp(8px, 1.7vh, 14px);
    padding: clamp(8px, 1.3vh, 11px) 12px;
    border-left: 4px solid #d94e2a;
    border-radius: 5px;
    color: #512115;
    background: #fff1ec;
    font-size: clamp(12px, 1.65vmin, 13.5px);
    line-height: 1.35;
}

generator-safety-gate .gs-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
    margin: 0 0 clamp(9px, 1.8vh, 17px);
    font-size: 13px;
}

generator-safety-gate .gs-links a {
    color: #9d3b22;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

generator-safety-gate .gs-check {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
    color: #333b48;
    font-size: clamp(12.5px, 1.7vmin, 14px);
    line-height: 1.35;
    cursor: pointer;
}

generator-safety-gate .gs-check input {
    width: 19px;
    height: 19px;
    margin: 1px 0 0;
    accent-color: #d94e2a;
    cursor: pointer;
}

generator-safety-gate .gs-footer {
    display: flex;
    flex: none;
    justify-content: flex-end;
    padding:
        clamp(10px, 2vh, 17px)
        clamp(16px, 3vw, 27px);
    border-radius: 0 0 13px 13px;
    background: #eef3f9;
}

generator-safety-gate .gs-button {
    min-height: 43px;
    padding: 10px 19px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #d94e2a;
    font: 800 14px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease,
        box-shadow 120ms ease;
}

generator-safety-gate .gs-button:not(:disabled):hover {
    background: #bd3f20;
    box-shadow: 0 5px 15px rgba(152, 47, 21, 0.25);
    transform: translateY(-1px);
}

generator-safety-gate .gs-button:disabled {
    color: rgba(255, 255, 255, 0.92);
    background: #aebbe7;
    cursor: not-allowed;
}

generator-safety-gate .gs-links a:focus-visible,
generator-safety-gate .gs-check input:focus-visible,
generator-safety-gate .gs-button:focus-visible {
    outline: 3px solid #246bfd;
    outline-offset: 3px;
}

/* ======================== Welcome overlay ======================= */

westinghouse-welcome {
    color: #ffffff;
    font-family: "WH Field Gothic", "Arial Narrow", Arial, sans-serif;
}

westinghouse-welcome .ww-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding:
        clamp(28px, 7vh, 64px)
        clamp(24px, 7.2vw, 140px)
        clamp(26px, 4vh, 38px);
    overflow-y: auto;
    overscroll-behavior: contain;
    color: #ffffff;
    background: rgba(65, 70, 79, 0.96);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    scrollbar-width: none;
}

westinghouse-welcome .ww-overlay::-webkit-scrollbar {
    width: 0;
    height: 0;
}

westinghouse-welcome .ww-content {
    display: flex;
    flex-direction: column;
    width: min(1640px, 100%);
    min-height: 100%;
    margin: 0;
    color: #ffffff;
}

westinghouse-welcome .ww-title {
    margin: 0;
    color: #ffffff;
    font-family: "WH Field Gothic", "Arial Narrow", Arial, sans-serif;
    font-size: clamp(28px, 2.15vw, 42px);
    font-style: normal;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.98;
}

westinghouse-welcome .ww-lead {
    margin: clamp(7px, 1vh, 12px) 0 0;
    color: #ffffff;
    font-size: clamp(18px, 1.55vw, 30px);
    font-weight: 400;
    letter-spacing: -0.012em;
    line-height: 1.16;
}

westinghouse-welcome .ww-lead strong {
    font-weight: 700;
}

westinghouse-welcome .ww-section {
    margin-top: clamp(24px, 4.4vh, 44px);
}

westinghouse-welcome .ww-section-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(19px, 1.45vw, 28px);
    font-weight: 700;
    letter-spacing: -0.018em;
    line-height: 1.04;
    text-transform: uppercase;
}

westinghouse-welcome .ww-copy {
    margin: clamp(5px, 0.7vh, 9px) 0 0;
    color: #ffffff;
    font-size: clamp(18px, 1.55vw, 30px);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.17;
}

westinghouse-welcome .ww-link {
    display: inline;
    color: #ffffff;
    font: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

westinghouse-welcome .ww-link:hover {
    text-decoration-thickness: 2px;
}

westinghouse-welcome .ww-start {
    align-self: flex-start;
    margin: auto 0 0;
    padding: clamp(30px, 5vh, 58px) 0 0;
    border: 0;
    border-radius: 0;
    color: #ffffff;
    background: transparent;
    font-family: "WH Field Gothic", "Arial Narrow", Arial, sans-serif;
    font-size: clamp(19px, 1.5vw, 29px);
    font-weight: 400;
    line-height: 1;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}

westinghouse-welcome .ww-start-arrow {
    display: inline-block;
    margin-left: 4px;
    transition: transform 150ms ease;
}

westinghouse-welcome .ww-start:hover .ww-start-arrow {
    transform: translateX(5px);
}

westinghouse-welcome .ww-link:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 5px;
}

westinghouse-welcome .ww-start,
westinghouse-welcome .ww-start:focus,
westinghouse-welcome .ww-start:focus-visible,
westinghouse-welcome .ww-start:active {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 600px) {
    generator-safety-gate .gs-overlay {
        padding: 8px;
    }

    generator-safety-gate .gs-button {
        width: 100%;
    }

    westinghouse-welcome .ww-overlay {
        padding:
            max(24px, env(safe-area-inset-top))
            max(40px, env(safe-area-inset-right))
            max(24px, env(safe-area-inset-bottom))
            max(40px, env(safe-area-inset-left));
    }

    westinghouse-welcome .ww-title {
        font-size: clamp(27px, 8vw, 34px);
        line-height: 1;
    }

    westinghouse-welcome .ww-lead,
    westinghouse-welcome .ww-copy {
        font-size: clamp(17px, 5vw, 21px);
    }

    westinghouse-welcome .ww-section-title {
        font-size: clamp(18px, 5.3vw, 22px);
    }

    westinghouse-welcome .ww-section {
        margin-top: clamp(22px, 4vh, 32px);
    }

    westinghouse-welcome .ww-start {
        font-size: clamp(18px, 5vw, 21px);
    }
}

@media (max-height: 760px) and (min-width: 601px) {
    generator-safety-gate .gs-title {
        font-size: clamp(22px, 4.5vh, 29px);
    }

    generator-safety-gate .gs-rules {
        gap: 5px;
        padding: 8px 10px;
    }

    westinghouse-welcome .ww-overlay {
        padding-top: 28px;
        padding-bottom: 24px;
    }

    westinghouse-welcome .ww-title {
        font-size: clamp(27px, 4.8vh, 36px);
    }

    westinghouse-welcome .ww-lead,
    westinghouse-welcome .ww-copy {
        font-size: clamp(17px, 3.2vh, 24px);
        line-height: 1.12;
    }

    westinghouse-welcome .ww-section-title,
    westinghouse-welcome .ww-start {
        font-size: clamp(18px, 3.3vh, 25px);
    }

    westinghouse-welcome .ww-section {
        margin-top: clamp(22px, 4vh, 34px);
    }
}

@media (prefers-reduced-motion: reduce) {
    generator-safety-gate .gs-button,
    westinghouse-welcome .ww-start-arrow {
        transition: none;
    }
}

/* Small screens: pin "Let's get started" to the bottom of the popup so it is
   always visible without scrolling. */
@media (max-width: 900px), (max-height: 520px) {
    westinghouse-welcome .ww-start {
        position: sticky;
        bottom: 0;
        z-index: 2;
        align-self: stretch;
        margin-top: auto;
        padding: 16px 0 max(16px, env(safe-area-inset-bottom));
        background: rgba(65, 70, 79, 0.98);
        box-shadow: 0 -12px 12px -4px rgba(65, 70, 79, 0.98);
    }
}
