:root {
    color-scheme: light;
    --bg: #f3f6fa;
    --card: #ffffff;
    --text: #17202b;
    --muted: #667384;
    --line: #e3e8ef;
    --primary: #1877f2;
    --primary-dark: #0d5fc7;
    --success: #138a55;
    --success-bg: #eaf8f1;
    --error: #c83232;
    --error-bg: #fff0f0;
    --pending: #9b6412;
    --pending-bg: #fff6db;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--text);
}

button,
input {
    font: inherit;
}

.app-shell {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) 16px max(30px, env(safe-area-inset-bottom));
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

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

h1 {
    margin-bottom: 10px;
    font-size: clamp(28px, 5vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 0;
    font-size: 21px;
    letter-spacing: -0.015em;
}

.lead {
    max-width: 580px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}

.eyebrow,
.step-label {
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.card {
    margin-bottom: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 12px 36px rgba(30, 49, 76, 0.06);
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.data-grid > div {
    min-width: 0;
    padding: 13px 14px;
    border-radius: 13px;
    background: #f7f9fc;
}

.data-grid .wide {
    grid-column: 1 / -1;
}

dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

dd {
    overflow-wrap: anywhere;
    margin: 0;
    font-size: 15px;
    font-weight: 650;
}

.muted {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.primary-button {
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 13px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.primary-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.primary-button:active:not(:disabled) {
    transform: translateY(1px);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.primary-button.large {
    width: 100%;
    min-height: 54px;
    font-size: 16px;
}

.status-badge {
    flex: 0 0 auto;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge.pending {
    background: var(--pending-bg);
    color: var(--pending);
}

.status-badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.error {
    background: var(--error-bg);
    color: var(--error);
}

.gps-dot {
    width: 13px;
    height: 13px;
    border: 3px solid #d8e8ff;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 5px #edf5ff;
}

.progress-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    color: var(--muted);
    font-size: 14px;
}

.result-grid {
    margin-top: 16px;
}

.message {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}

.error-message,
.error-text {
    color: var(--error);
}

.error-message {
    background: var(--error-bg);
}

.success-message {
    background: var(--success-bg);
    color: var(--success);
}

.app-footer {
    padding: 5px 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.centered-page {
    display: grid;
    place-items: center;
    padding: 20px;
}

.install-card {
    width: min(440px, 100%);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 18px 60px rgba(30, 49, 76, 0.1);
    text-align: center;
}

.install-card .primary-button {
    margin-top: 18px;
}

.logo-mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-size: 23px;
    font-weight: 800;
}

.spinner {
    width: 30px;
    height: 30px;
    margin: 22px auto 0;
    border: 3px solid #dce8f8;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.small {
    width: 20px;
    height: 20px;
    margin: 0;
    border-width: 2px;
}

[hidden] {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 560px) {
    .app-shell {
        padding-right: 12px;
        padding-left: 12px;
    }

    .hero {
        display: block;
    }

    .status-badge {
        display: inline-block;
        margin-top: 14px;
    }

    .card {
        padding: 18px;
        border-radius: 17px;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .data-grid .wide {
        grid-column: auto;
    }
}

