/* ADR-040: the shared PWA install page (Views/Shared/AppInstall.cshtml) for Buyer + Provider.
   Layout + walkthrough ported from POTG SS-463. Brand font + colours come from the app's theme file
   (buyer-theme.css / provider-theme.css: --font-family, --gradient-primary, --color-primary, --text-*, --bg-*).
   The --ig-* block below is the ONLY place with raw colour values: the neutral greys of the step pictures,
   Apple's own control blue/green (they must look like the real iPhone), and the orange highlight ring that the
   copy refers to ("the orange circle"). */
:root {
    --ig-white: #ffffff;
    --ig-ink: #14213d;
    --ig-slate: #334155;
    --ig-muted: #64748b;
    --ig-faint: #b8c4d4;
    --ig-bar: #cbd5e1;
    --ig-bar2: #dce3ec;
    --ig-tile: #d9e1ea;
    --ig-border: #d5dce6;
    --ig-line: #e2e8f0;
    --ig-chip: #eef2f7;
    --ig-field: #f1f4f8;
    --ig-art: #f4f7fb;
    --ig-hot: #fff1e8;
    --ig-iosblue: #0a84ff;
    --ig-iosgreen: #34c759;
    --ig-ring: #e8590c;
    --ig-shadow: rgba(20, 33, 61, 0.14);
}

[hidden] {
    display: none !important;
}

body.install-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.ip-shell {
    box-sizing: border-box;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- header (brand gradient) ---------- */
.ip-header {
    padding: calc(20px + env(safe-area-inset-top)) 20px 60px;
    background: var(--gradient-primary);
    color: var(--ig-white);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ip-brand {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 14px;
    background: var(--ig-white);
    color: var(--text-primary);
    max-width: 100%;
    min-width: 0;
}

.ip-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex: 0 0 auto;
}

.ip-brand-name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    min-width: 0;
}

.ip-heading {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.15;
    font-weight: 800;
}

.ip-intro {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ---------- the white card that overlaps the header ---------- */
.ip-panel {
    margin: -40px 16px 0;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--ig-shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.ip-center {
    align-items: center;
    text-align: center;
}

.ip-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ip-small {
    font-size: 0.875rem;
}

.ip-url {
    word-break: break-all;
    color: var(--text-primary);
}

.ip-steps {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ip-steps strong {
    color: var(--text-primary);
}

.ip-divider {
    align-self: stretch;
    border-top: 1px solid var(--border-color);
}

.ip-label {
    display: block;
    margin: 8px 0 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ip-input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin-bottom: 10px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-muted);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

/* ---------- buttons ---------- */
.ip-btn {
    min-height: 48px;
    padding: 0 22px;
    border: none;
    border-radius: 24px;
    background: var(--color-primary);
    color: var(--ig-white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.ip-btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.ip-btn-block {
    width: 100%;
}

.ip-link-btn {
    min-height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.ip-help {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ip-qr {
    width: 200px;
    height: 200px;
    padding: 8px;
    box-sizing: border-box;
    background: var(--ig-white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-qr img,
.ip-qr canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.ip-foot {
    margin: 18px 24px 0;
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: center;
    color: var(--text-muted);
}

.ip-return {
    display: flex;
    justify-content: center;
    margin: 18px 24px 90px; /* room for the iOS 26 hint, fixed bottom right */
}

/* ---------- walkthrough ---------- */
.ig-platform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ig-platform > span {
    min-width: 0;
}

.ig-platform strong {
    color: var(--text-primary);
}

.ig-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ig-option {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.ig-option[aria-current="true"] {
    border: 2px solid var(--color-primary);
    font-weight: 700;
}

.ig-count {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ig-art {
    padding: 8px;
    border-radius: 14px;
    background: var(--ig-art);
    touch-action: pan-y;
}

.ig-svg {
    display: block;
    width: 100%;
    height: auto;
}

.ig-title {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text-primary);
}

.ig-sub {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.ig-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ig-nav .ip-btn {
    flex: 0 0 auto;
    padding: 0 18px;
}

.ig-invisible {
    visibility: hidden;
}

.ig-dots {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    min-width: 0;
}

.ig-dot {
    flex: 0 0 auto;
    width: 18px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ig-dot span {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--ig-faint);
}

.ig-dot[aria-current="step"] span {
    width: 16px;
    background: var(--color-primary);
}

.ig-hint {
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    animation: ig-bob 1.2s ease-in-out infinite;
    pointer-events: none;
}

.ig-hint span {
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--ig-ring);
    color: var(--ig-white);
    font-size: 13px;
    font-weight: 700;
}

.ig-hint-arrow {
    width: 28px;
    height: 28px;
}

/* the pictures: every colour through a variable */
.ig-ln { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ig-t { font-family: var(--font-family); font-size: 12px; fill: var(--ig-slate); }
.ig-ts { font-family: var(--font-family); font-size: 10px; fill: var(--ig-muted); }
.ig-tb { font-weight: 700; fill: var(--ig-ink); }
.ig-tw { font-weight: 800; fill: var(--ig-white); }
.ig-tc { text-anchor: middle; }
.ig-ring { fill: none; stroke: var(--ig-ring); stroke-width: 3; }
.ig-pulse { transform-box: fill-box; transform-origin: center; animation: ig-pulse 1.6s ease-out infinite; }
.f-bar { fill: var(--ig-bar); }
.f-bar2 { fill: var(--ig-bar2); }
.f-chip { fill: var(--ig-chip); }
.f-field { fill: var(--ig-field); }
.f-hot { fill: var(--ig-hot); }
.f-ink { fill: var(--ig-ink); }
.f-iosblue { fill: var(--ig-iosblue); }
.f-iosgreen { fill: var(--ig-iosgreen); }
.f-tile { fill: var(--ig-tile); }
.f-white { fill: var(--ig-white); }
.s-border { stroke: var(--ig-border); }
.s-faint { stroke: var(--ig-faint); }
.s-ink { stroke: var(--ig-ink); }
.s-iosblue { stroke: var(--ig-iosblue); }
.s-line { stroke: var(--ig-line); }
.s-muted { stroke: var(--ig-muted); }
.s-ring { stroke: var(--ig-ring); }
.s-slate { stroke: var(--ig-slate); }

@keyframes ig-pulse {
    0% { opacity: 0.9; transform: scale(0.9); }
    100% { opacity: 0; transform: scale(1.35); }
}

@keyframes ig-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .ig-pulse,
    .ig-hint {
        animation: none;
    }
}
