:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-strong: #f0f4f8;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #455f84;
    --primary-dark: #263a55;
    --accent: #16c79a;
    --danger: #b42318;
    --warning: #a15c07;
    --ok: #067647;
    --border: rgba(15, 23, 42, 0.11);
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top left, rgba(29, 60, 115, 0.16), transparent 30%), var(--bg);
    color: var(--text);
    touch-action: manipulation;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100svh;
    overflow-x: hidden;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button {
    min-height: 52px;
    touch-action: manipulation;
}

input,
select,
textarea {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-size: 16px;
}

img,
svg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(69, 95, 132, 0.1);
    color: var(--primary-dark);
}

.install-view,
.app-shell {
    display: none;
}

.install-view.visible,
.app-shell.visible {
    display: flex;
}

.install-view {
    min-height: 100svh;
    align-items: center;
    justify-content: center;
    padding: calc(22px + var(--safe-top)) 18px calc(22px + var(--safe-bottom));
}

.install-card,
.hero-card {
    width: min(100%, 720px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.install-card {
    position: relative;
    overflow: hidden;
    padding: 28px 28px 64px;
    text-align: left;
}

.install-card::after {
    content: "";
    position: absolute;
    inset: auto -80px -120px auto;
    width: 260px;
    height: 260px;
    background: rgba(69, 95, 132, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.brand-icon,
.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 18px 40px rgba(69, 95, 132, 0.25);
    font-weight: 800;
    letter-spacing: -0.08em;
}

.brand-icon {
    width: 74px;
    height: 74px;
    font-size: 26px;
    margin-bottom: 18px;
}

.logo-mark {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    font-size: 20px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #1d3c73;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

.install-card h1,
.app-header h1,
.hero-content h2 {
    color: var(--text);
    letter-spacing: -0.035em;
}

.install-card h1 {
    margin-bottom: 12px;
    font-size: clamp(28px, 9vw, 44px);
    line-height: 0.98;
}

.muted,
.hint {
    color: var(--muted);
    line-height: 1.48;
}

.hint {
    margin: -2px 0 4px;
    font-size: 13px;
}

.install-steps {
    margin: 24px 0;
}

.install-steps ol {
    counter-reset: steps;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.install-steps li {
    counter-increment: steps;
    position: relative;
    min-height: 48px;
    padding: 12px 14px 12px 62px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    line-height: 1.45;
}

.install-steps li::before {
    content: counter(steps);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text);
    color: #fff;
    font-weight: 800;
}

.inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    padding: 3px 8px;
    margin: 0 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    vertical-align: middle;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    font-weight: 800;
}

.inline-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.info-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 8px;
    background: #ffffff;
    vertical-align: middle;
    box-shadow: 1px 1px 2px rgba(15, 23, 42, 0.22);
    color: #0f172a;
    font-weight: 800;
    white-space: nowrap;
}

.info-img svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.install-note {
    margin: 16px 0 4px;
    text-align: left;
    font-size: 15px;
    line-height: 1.45;
    color: var(--muted);
}

.arrow_ios,
.arrow_android {
    position: absolute;
    width: 54px;
    height: 54px;
    pointer-events: none;
    color: #0f172a;
    opacity: 0.82;
}

.arrow_ios {
    left: 0;
    right: 0;
    bottom: 8px;
    margin: auto;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' fill='%230f172a' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1'/%3E%3C/svg%3E");
}

.arrow_android {
    top: 4px;
    right: 4px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' fill='%230f172a' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5'/%3E%3C/svg%3E");
}

@keyframes bounceIn {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-24px); }
    60% { transform: translateY(-12px); }
}

@keyframes bounceOut {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(24px); }
    60% { transform: translateY(12px); }
}

.bounceIn {
    animation: bounceIn 1s infinite 1s;
}

.bounceOut {
    animation: bounceOut 1s infinite 1s;
}

.secondary-button,
.primary-button,
.icon-button {
    border: 0;
    border-radius: 999px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.secondary-button {
    width: 100%;
    background: var(--surface-strong);
    color: var(--primary-dark);
    font-weight: 800;
    padding: 0 18px;
}

.primary-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    padding: 0 22px;
    box-shadow: 0 18px 42px rgba(69, 95, 132, 0.28);
}


.install-action {
    margin-top: 4px;
    margin-bottom: 12px;
}

.install-action[hidden] {
    display: none !important;
}

.install-action:disabled {
    opacity: 0.68;
}

.primary-button svg,
.icon-button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.primary-button:disabled,
.icon-button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active,
.icon-button:not(:disabled):active {
    transform: scale(0.98);
}

.app-shell {
    min-height: 100svh;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: calc(16px + var(--safe-top)) 14px calc(22px + var(--safe-bottom));
}

.app-header {
    width: min(100%, 720px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 2px 2px;
}

.app-header h1 {
    margin: 0;
    font-size: clamp(24px, 7vw, 38px);
    line-height: 1;
}

.icon-button {
    margin-left: auto;
    width: 52px;
    min-width: 52px;
    color: var(--primary-dark);
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.hero-card {
    overflow: hidden;
}

.truck-visual {
    position: relative;
    height: clamp(170px, 38vw, 260px);
    overflow: hidden;
    background: #e5eaf0;
}

.truck-visual picture {
    position: absolute;
    inset: 0;
    display: block;
}

.truck-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.hero-content {
    padding: clamp(18px, 5vw, 30px);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    margin-bottom: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.status-pill.ok {
    background: var(--ok);
}

.status-pill.error {
    background: var(--danger);
}

.hero-content h2 {
    margin-bottom: 8px;
    font-size: clamp(26px, 7vw, 40px);
    line-height: 1;
}

.dispatch-form {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.field-label {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

select,
.text-input {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    outline: none;
    padding: 0 48px 0 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

select {
    appearance: none;
    -webkit-appearance: none;
}

.text-input {
    padding-right: 16px;
    text-transform: uppercase;
}

select:focus,
.text-input:focus {
    border-color: rgba(69, 95, 132, 0.5);
    box-shadow: 0 0 0 4px rgba(69, 95, 132, 0.12);
}

.divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    background: var(--border);
}

.message {
    display: none;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    line-height: 1.42;
}

.message.visible {
    display: block;
}

.message.success {
    color: var(--ok);
    background: rgba(6, 118, 71, 0.1);
}

.message.error {
    color: var(--danger);
    background: rgba(180, 35, 24, 0.1);
}

.message.info {
    color: var(--primary-dark);
    background: rgba(69, 95, 132, 0.1);
}


@media (min-width: 760px) {
    .app-shell {
        padding-top: calc(24px + var(--safe-top));
    }

    .hero-card {
        display: grid;
        grid-template-columns: 0.95fr 1.05fr;
        align-items: stretch;
    }

    .truck-visual {
        height: auto;
        min-height: 520px;
    }

    .hero-content {
        align-self: center;
    }
}

@media (max-width: 380px) {
    .install-card,
    .hero-content {
        padding: 18px;
    }

    .truck-visual {
        height: 136px;
    }

    .primary-button {
        font-size: 15px;
    }
}
