/**
 * Hero UX Improvements
 * Compact hero, sticky header fix, quiz enhancements, micro-animations
 */

/* ===== CSS VARIABLES ===== */
:root {
    --header-height: 110px;
    --header-compact-height: 72px;
    --hero-pt: 36px;
    --hero-pb: 42px;
}

@media (max-width: 767px) {
    :root {
        --header-height: 72px;
        --header-compact-height: 56px;
    }
}

/* ===== STICKY HEADER FIX ===== */
html {
    scroll-padding-top: var(--header-height);
}

/* Compact header on scroll */
.header .top-bar {
    max-height: 50px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
}

.header.is-compact .top-bar {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.header.is-compact .header-main {
    padding: 8px 0;
}

.header.is-compact {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

body.header-is-compact {
    scroll-padding-top: var(--header-compact-height);
}

/* Internal pages: compensate for fixed header */
.service-page,
body:not(.home) .section:first-child {
    padding-top: var(--header-height);
}

/* ===== HERO COMPACT ===== */
.hero.section {
    padding: calc(var(--hero-pt) + var(--header-height)) 0 var(--hero-pb);
    min-height: 100vh;
    display: flex;
    align-items: center;
    background:
        linear-gradient(
            90deg,
            rgba(6, 33, 30, 0.96) 0%,
            rgba(8, 57, 51, 0.9) 36%,
            rgba(9, 92, 80, 0.68) 63%,
            rgba(6, 33, 30, 0.72) 100%
        ),
        linear-gradient(
            180deg,
            rgba(4, 35, 31, 0.18) 0%,
            rgba(4, 35, 31, 0.62) 100%
        ),
        url("../images/hero-master-opening-safe.jpg") center right / cover no-repeat;
    background-color: var(--color-primary);
}

.hero.section::before,
.hero.section::after {
    display: none;
}

.hero.section .container {
    width: 100%;
}

.hero-grid {
    align-items: center;
    gap: 40px;
}

@media (min-width: 1025px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
        align-items: center;
        gap: clamp(32px, 4vw, 64px);
    }

    .hero-content {
        min-width: 0;
        max-width: 100%;
    }

    .hero-request {
        width: 100%;
        max-width: 540px;
        justify-self: end;
        min-width: 0;
    }
}

/* ===== H1 COMPACT ===== */
.hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    line-height: 1.08;
    margin-bottom: 16px;
    max-width: 720px;
}

.hero h1 span {
    margin-top: 4px;
}

@media (min-width: 1025px) {
    .hero h1 {
        font-size: clamp(46px, 3.4vw, 60px);
        line-height: 1.04;
        max-width: 100%;
        min-width: 0;
        overflow-wrap: normal;
        word-break: normal;
    }

    .hero h1 span {
        white-space: normal;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .hero h1 {
        font-size: clamp(2.6rem, 4vw, 3.4rem);
    }
}

/* Desktop breakpoint sub-ranges */
@media (min-width: 1025px) and (max-width: 1280px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
        gap: 28px;
    }

    .hero h1 {
        font-size: clamp(44px, 4vw, 52px);
    }

    .hero-request {
        max-width: 460px;
    }
}

@media (min-width: 1281px) and (max-width: 1536px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1.1fr) minmax(430px, 510px);
        gap: 36px;
    }

    .hero-request {
        max-width: 510px;
    }
}

@media (min-width: 1537px) {
    .hero-request {
        max-width: 540px;
    }
}

/* ===== HERO SUBTITLE COMPACT ===== */
.hero-subtitle {
    font-size: 16px;
    max-width: 640px;
    margin-bottom: 22px;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 17px;
    }
}

/* ===== HERO FEATURES COMPACT ===== */
.hero-features {
    gap: 10px;
    margin-bottom: 24px;
}

.hero-feature {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.hero-feature-icon {
    width: 16px;
    height: 16px;
}

.hero-feature-icon svg {
    width: 16px;
    height: 16px;
}

/* ===== CTA BUTTONS HIERARCHY ===== */
.hero-buttons {
    gap: 12px;
    margin-bottom: 0;
    align-items: center;
}

.hero-buttons .btn-primary-cta {
    background-color: var(--color-orange);
    color: var(--color-white);
    font-size: 16px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(248, 154, 61, 0.3);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-buttons .btn-primary-cta:hover {
    background-color: var(--color-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248, 154, 61, 0.4);
}

.hero-buttons .btn-primary-cta:focus-visible {
    outline: 3px solid var(--color-orange);
    outline-offset: 2px;
}

.hero-buttons .btn-primary-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(248, 154, 61, 0.3);
}

.hero-buttons .btn-secondary-cta {
    background: transparent;
    color: var(--color-white);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-buttons .btn-secondary-cta:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}

.hero-buttons .btn-secondary-cta:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

.hero-buttons .btn-secondary-cta:active {
    transform: translateY(0);
}

.hero-prices-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hero-prices-link:hover {
    color: var(--color-white);
}

.hero-prices-link:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== QUIZ CARD COMPACT ===== */
.hero-request {
    padding: 24px 24px 20px;
    border-radius: 18px;
}

.sg-quiz,
.quiz-success {
    min-height: auto;
}

.quiz-head {
    margin-bottom: 14px;
}

.quiz-title {
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 2px;
}

.quiz-subtitle {
    font-size: 13px;
    color: var(--color-secondary);
    margin: 0 0 4px;
    font-weight: 400;
}

.quiz-question {
    font-size: 15px;
    margin-bottom: 2px;
}

.quiz-step {
    gap: 10px;
}

/* ===== QUIZ OPTIONS STATES ===== */
.quiz-tile {
    min-height: 46px;
    padding: 10px 14px;
    border-width: 1.5px;
    font-size: 14px;
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.quiz-tile:hover {
    transform: translateY(-1px);
    border-color: var(--color-accent);
    background: var(--color-light-bg);
    box-shadow: 0 2px 8px rgba(0, 111, 102, 0.08);
}

.quiz-tile:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.quiz-tile.is-selected {
    border-color: var(--color-orange);
    background: #fff4e8;
    box-shadow: 0 0 0 2px rgba(248, 154, 61, 0.12);
    font-weight: 700;
}

.quiz-tile.is-selected svg {
    color: var(--color-orange);
}

/* Selected indicator */
.quiz-tile-check {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--color-orange);
}

.quiz-tile.is-selected .quiz-tile-check {
    display: inline-flex;
}

/* ===== QUIZ NEXT BUTTON ===== */
.quiz-next-btn,
.quiz-next-btn.btn-orange {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 24px;
    margin-top: 6px;
    background-color: var(--color-orange);
    color: var(--color-white);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.quiz-next-btn:hover:not(:disabled),
.quiz-next-btn.btn-orange:hover:not(:disabled) {
    background-color: var(--color-orange-hover);
    transform: translateY(-1px);
}

.quiz-next-btn:focus-visible {
    outline: 3px solid var(--color-orange);
    outline-offset: 2px;
}

.quiz-next-btn:active:not(:disabled) {
    transform: translateY(0);
}

.quiz-next-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== QUIZ HINT ===== */
.quiz-hint {
    font-size: 12px;
    color: var(--color-secondary);
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
}

/* ===== QUIZ BACK BUTTON ON STEPS 2-3 ===== */
.quiz-step-back {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--color-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
    margin-bottom: 4px;
}

.quiz-step-back svg {
    width: 14px;
    height: 14px;
    transform: rotate(180deg);
}

.quiz-step-back:hover {
    color: var(--color-primary);
}

/* ===== HERO BADGE PULSE ===== */
.hero-badge-dot {
    animation: badgePulse 2.8s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
}

@keyframes badgePulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 0 4px rgba(74, 222, 128, 0);
    }
}

/* ===== HERO ENTRANCE ANIMATIONS ===== */
.hero-animate {
    opacity: 0;
    transform: translateY(12px);
}

.hero-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-animate[data-delay="1"] { transition-delay: 0ms; }
.hero-animate[data-delay="2"] { transition-delay: 70ms; }
.hero-animate[data-delay="3"] { transition-delay: 140ms; }
.hero-animate[data-delay="4"] { transition-delay: 210ms; }
.hero-animate[data-delay="5"] { transition-delay: 280ms; }
.hero-animate[data-delay="6"] { transition-delay: 350ms; }

/* Fallback: show content if JS disabled */
.no-js .hero-animate {
    opacity: 1;
    transform: none;
}

/* ===== QUIZ STEP TRANSITION ===== */
@keyframes quizStepIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-step.active {
    animation: quizStepIn 0.25s ease forwards;
}

/* ===== PROGRESS BAR SMOOTH ===== */
.quiz-progress-bar {
    transition: width 0.3s ease;
}

/* ===== ARIA LIVE REGION ===== */
.quiz-aria-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 767px) {
    .hero.section {
        padding: calc(var(--hero-pt) + var(--header-height) - 16px) 0 32px;
        min-height: auto;
        align-items: flex-start;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero h1 {
        font-size: clamp(1.75rem, 7vw, 2.4rem);
        line-height: 1.12;
    }

    .hero h1 span {
        white-space: normal;
    }

    .hero-subtitle {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .hero-features {
        gap: 8px;
        margin-bottom: 20px;
    }

    .hero-buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        font-size: 16px;
    }

    .hero-prices-link {
        text-align: center;
        display: flex;
        justify-content: center;
        margin-top: 6px;
    }

    .hero-request {
        padding: 20px 16px 18px;
        border-radius: 14px;
    }

    .quiz-tiles {
        grid-template-columns: 1fr;
    }

    .quiz-tile--input {
        grid-column: span 1;
    }

    .quiz-tile {
        min-height: 48px;
        padding: 12px 14px;
    }

    .quiz-next-btn {
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero.section {
        min-height: auto;
        padding: calc(var(--hero-pt) + var(--header-height)) 0 var(--hero-pb);
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-request {
        max-width: 500px;
    }
}

/* ===== 1366px OPTIMIZATION ===== */
@media (min-width: 1025px) and (max-height: 800px) {
    :root {
        --hero-pt: 28px;
        --hero-pb: 32px;
    }

    .hero h1 {
        margin-bottom: 12px;
    }

    .hero-subtitle {
        margin-bottom: 16px;
        font-size: 15px;
    }

    .hero-features {
        margin-bottom: 18px;
    }

    .hero-request {
        padding: 20px 22px 18px;
    }

    .quiz-head {
        margin-bottom: 10px;
    }

    .quiz-title {
        font-size: 16px;
    }

    .quiz-tiles {
        gap: 6px;
    }

    .quiz-tile {
        min-height: 42px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .quiz-next-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ===== DESKTOP FINAL POLISH ===== */
@media (min-width: 1025px) {
    /* 4+6. Lower quiz card + background image */
    .hero-request {
        margin-top: 20px;
        position: relative;
        overflow: hidden;
        background:
            linear-gradient(
                rgba(255, 255, 255, 0.91),
                rgba(255, 255, 255, 0.95)
            ),
            url("../images/quiz-electronic-safe.webp")
            center / cover no-repeat;
        background-color: #fff;
    }

    /* 5. Quiz compact: reduce gap between subtitle and question */
    .quiz-subtitle {
        margin-bottom: 6px;
    }

    .quiz-question {
        margin-top: 0;
        margin-bottom: 4px;
    }

    /* 6.5. Keep quiz options white and readable */
    .quiz-tile {
        background: rgba(255, 255, 255, 0.96);
    }

    .quiz-tile.is-selected {
        background: #fff4e8;
    }

    /* 7. Primary CTA slightly more compact */
    .hero-buttons .btn-primary-cta {
        padding: 14px 26px;
        min-width: auto;
    }

    /* 8. Prices link: more visible, add arrow */
    .hero-prices-link {
        margin-top: 14px;
        color: rgba(255, 255, 255, 0.82);
        gap: 6px;
        text-decoration-thickness: 1px;
        text-underline-offset: 4px;
    }

    .hero-prices-link::after {
        content: "\2192";
        font-size: 15px;
        transition: transform 0.2s ease;
    }

    .hero-prices-link:hover {
        color: #ffffff;
    }

    .hero-prices-link:hover::after {
        transform: translateX(3px);
    }

    /* 9. Benefits gap */
    .hero-features {
        gap: 14px;
    }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-animate {
        opacity: 1;
        transform: none;
    }
}

/* ===== SAFE KEYPAD HERO ===== */
.hero-grid {
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    max-width: 720px;
}

.hero-subtitle {
    max-width: 650px;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: 760px;
}

.hero-feature {
    min-width: 0;
    padding: 0;
    gap: 9px;
    align-items: center;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
}

.hero-feature-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    color: #6ee7c7;
    border: 1px solid rgba(110, 231, 199, 0.46);
    border-radius: 10px;
    background: rgba(3, 47, 42, 0.35);
}

.hero-feature-icon svg {
    width: 18px;
    height: 18px;
}

.hero-feature-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.hero-feature-copy strong {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.hero-feature-copy small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
}

.safe-keypad {
    --keypad-edge: clamp(18px, 2.2vw, 30px);
    position: relative;
    z-index: 2;
    width: clamp(420px, 32vw, 500px);
    max-width: 100%;
    aspect-ratio: 1;
    justify-self: end;
    padding: var(--keypad-edge);
    border-radius: 50%;
    background:
        linear-gradient(145deg, #77756d 0%, #c3bdad 20%, #8c887c 42%, #d0c8b5 61%, #6e6d67 82%, #aaa393 100%);
    border: 1px solid rgba(238, 230, 209, 0.44);
    box-shadow:
        0 28px 55px rgba(0, 0, 0, 0.34),
        0 8px 18px rgba(0, 0, 0, 0.28),
        inset 0 2px 2px rgba(255, 255, 255, 0.48),
        inset 0 -3px 8px rgba(31, 29, 25, 0.5);
    isolation: isolate;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.safe-keypad::before,
.safe-keypad::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.safe-keypad::before {
    inset: 2.2%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 0 0 1px rgba(36, 35, 31, 0.24);
}

.safe-keypad::after {
    inset: 8%;
    z-index: 1;
    background: radial-gradient(circle at 50% 38%, rgba(13, 79, 70, 0.36), rgba(1, 24, 22, 0.72) 72%);
    filter: blur(2px);
}

.safe-keypad__ring {
    position: absolute;
    inset: 6.6%;
    z-index: 2;
    border-radius: 50%;
    border: 2px solid rgba(32, 34, 31, 0.64);
    box-shadow:
        0 0 0 1px rgba(230, 222, 202, 0.3),
        inset 0 0 12px rgba(0, 0, 0, 0.54);
    pointer-events: none;
}

.safe-keypad__body {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    padding: 24% 14% 17%;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid rgba(204, 198, 179, 0.52);
    background:
        radial-gradient(circle at 50% 36%, rgba(17, 75, 68, 0.82) 0%, rgba(5, 43, 39, 0.95) 46%, #031f1d 100%);
    box-shadow:
        inset 0 0 0 4px rgba(2, 25, 23, 0.72),
        inset 0 18px 32px rgba(0, 0, 0, 0.34),
        inset 0 -16px 28px rgba(0, 0, 0, 0.48);
}

.safe-keypad__display {
    position: absolute;
    top: 8.4%;
    left: 25%;
    width: 50%;
    height: 11.5%;
    border-radius: 50% 50% 44% 44% / 58% 58% 42% 42%;
    background: linear-gradient(180deg, #111a19 0%, #050908 100%);
    border: 1px solid rgba(172, 168, 152, 0.44);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.9),
        0 2px 0 rgba(225, 216, 194, 0.2);
}

.safe-keypad__grid {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: clamp(7px, 0.75vw, 11px);
}

.safe-keypad__key {
    min-width: 0;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(228, 232, 225, 0.82);
    border-radius: clamp(8px, 0.8vw, 12px);
    color: #15201e;
    background: linear-gradient(180deg, #eef0eb 0%, #d4d8d3 52%, #b9bfba 100%);
    box-shadow:
        inset 0 2px 1px rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(81, 91, 86, 0.2),
        0 4px 0 #7f8984,
        0 7px 9px rgba(0, 0, 0, 0.34);
    font: inherit;
    cursor: pointer;
    transform: translateY(0) scale(1);
    transform-origin: center;
    transition:
        transform 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease;
    touch-action: manipulation;
}

.safe-keypad__key > span {
    display: block;
    font-size: clamp(22px, 2.15vw, 32px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
}

.safe-keypad__key--word > span {
    font-size: clamp(13px, 1.35vw, 20px);
    letter-spacing: 0;
}

.safe-keypad__key:hover {
    border-color: #ffffff;
    background: linear-gradient(180deg, #ffffff 0%, #e0e4df 56%, #c2c8c3 100%);
}

.safe-keypad__key:focus-visible {
    outline: 3px solid rgba(248, 154, 61, 0.9);
    outline-offset: 3px;
}

.safe-keypad__key.is-pressed,
.safe-keypad__key:active {
    transform: translateY(3px) scale(0.96);
    background: linear-gradient(180deg, #c8cec9 0%, #aeb7b1 100%);
    box-shadow:
        inset 0 3px 5px rgba(43, 54, 50, 0.26),
        0 1px 0 #75807a,
        0 3px 5px rgba(0, 0, 0, 0.28);
}

.safe-keypad__led {
    position: absolute;
    z-index: 4;
    top: 44.5%;
    width: clamp(10px, 1vw, 14px);
    height: clamp(10px, 1vw, 14px);
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.62);
    transition: background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.safe-keypad__led--green {
    left: 5.2%;
    background: #174d3d;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.75);
    opacity: 0.72;
}

.safe-keypad__led--red {
    right: 5.2%;
    background: #5a2025;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.75);
    opacity: 0.66;
}

.safe-keypad__led--green.is-active {
    background: #36de84;
    box-shadow:
        0 0 8px rgba(54, 222, 132, 0.9),
        0 0 18px rgba(54, 222, 132, 0.42),
        inset 0 1px 2px rgba(255, 255, 255, 0.55);
    opacity: 1;
}

.safe-keypad__led--red.is-active {
    background: #ee4757;
    box-shadow:
        0 0 9px rgba(238, 71, 87, 0.88),
        0 0 20px rgba(238, 71, 87, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.48);
    opacity: 1;
}

.safe-keypad__lower-inset {
    position: absolute;
    z-index: 1;
    left: 31%;
    bottom: 5.2%;
    width: 38%;
    height: 8.5%;
    border-radius: 42% 42% 52% 52% / 50% 50% 64% 64%;
    background: linear-gradient(180deg, #101817, #030706);
    border: 1px solid rgba(174, 169, 152, 0.36);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

@media (min-width: 1200px) {
    .hero-grid {
        grid-template-columns: minmax(0, 55fr) minmax(420px, 45fr);
        gap: clamp(30px, 3vw, 52px);
    }

    .hero-content {
        max-width: 760px;
    }

    .hero h1 {
        font-size: clamp(40px, 3vw, 46px);
        line-height: 1.08;
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
        gap: 26px;
    }

    .hero h1 {
        font-size: clamp(38px, 3.9vw, 42px);
        line-height: 1.08;
    }

    .hero-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .safe-keypad {
        width: clamp(340px, 36vw, 380px);
    }
}

@media (min-width: 768px) and (max-width: 899px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-features {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .safe-keypad {
        width: clamp(320px, 46vw, 360px);
        justify-self: center;
    }
}

@media (max-width: 767px) {
    .hero-grid {
        gap: 28px;
    }

    .hero h1 {
        max-width: 100%;
    }

    .hero-subtitle br {
        display: none;
    }

    .hero-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 14px;
        margin-bottom: 22px;
    }

    .hero-feature-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .hero-feature-copy strong {
        font-size: 12px;
    }

    .hero-feature-copy small {
        font-size: 10px;
    }

    .safe-keypad {
        --keypad-edge: clamp(15px, 5.5vw, 20px);
        width: clamp(260px, 82vw, 300px);
        max-width: 90vw;
        justify-self: center;
    }

    .safe-keypad__grid {
        gap: 7px;
    }

    .safe-keypad__key {
        border-radius: 8px;
    }

    .safe-keypad__key > span {
        font-size: clamp(19px, 6vw, 24px);
    }

    .safe-keypad__key--word > span {
        font-size: clamp(12px, 3.8vw, 15px);
    }
}

@media (max-width: 390px) {
    .hero-feature {
        gap: 7px;
    }

    .hero-feature-icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .hero-buttons .btn {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .safe-keypad__key,
    .safe-keypad__led {
        transition: none !important;
    }
}
