/* Customer page - DESIGN.md Z1 tokens as CSS (story 1.4).
   Logical properties only (RTL/LTR both first-class). All sizes in rem (base 16)
   so user font-size settings are honored (WCAG). */

:root {
    /* Z1 palette (contrast-validated in DESIGN.md) */
    --c-canvas: #ECEEF1;
    --c-card: #FFFFFF;
    --c-ink: #101319;
    --c-black: #14161A;
    --c-muted: #646B76;
    --c-border: #E4E7EC;
    --c-hatch: #8A919C;
    --c-surface-muted: #F1F3F6;
    --c-primary: #2861ED;
    --c-primary-tint: #EAF0FF;
    --c-alert: #FF5C00;
    --c-alert-text: #C2410C;
    --c-positive: #15803D;
    --c-positive-tint: #E9F7EE;

    /* radii + shadows */
    --r-md: 10px;
    --r-xl: 20px;
    --r-xxl: 22px;
    --r-full: 9999px;
    --shadow-card: 0 10px 26px -16px rgba(16, 19, 25, .14);
    --shadow-sticky: 0 16px 32px -14px rgba(16, 19, 25, .28);

    /* customer type scale: label 13 / body-number 16 / title 28 (rem) */
    --fs-label: 0.8125rem;
    --fs-body: 1rem;
    --fs-title: 1.75rem;
}

/* ---- shell: one centered column, max 480px, sticky bar pinned to it ---- */

.customer-shell {
    min-height: 100vh; /* fallback for browsers without dvh (older iOS Safari) */
    min-height: 100dvh;
    background: var(--c-canvas);
    color: var(--c-ink);
    font-family: 'Rubik', 'Segoe UI', 'Heebo', Arial, sans-serif;
    font-size: var(--fs-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* rem bottom room so the sticky bar clears content even at 200% text zoom */
    padding: 18px 14px;
    padding-block-end: calc(7rem + env(safe-area-inset-bottom));
}

.customer-col {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---- cards ---- */

.c-card {
    background: var(--c-card);
    border-radius: var(--r-xl);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.c-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 20px;
}

.c-hero svg { max-width: 100%; height: auto; }
.c-hero-img { max-width: 100%; max-height: 220px; height: auto; object-fit: contain; } /* managed product image (3.5) */

/* ---- greeting header ---- */

.c-greeting { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* DESIGN.md token weights: customer-label 600, customer-number 800 (-0.02em) */
.c-greeting .label { font-size: var(--fs-label); color: var(--c-muted); font-weight: 600; }
.c-greeting h1 { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 0; line-height: 1.15; }

/* mono values: always LTR-isolated (MAC, versions, codes) */
.c-mono {
    font-family: Consolas, 'Segoe UI', monospace;
    direction: ltr;
    unicode-bidi: isolate;
}

.c-version-pill {
    background: var(--c-surface-muted);
    color: var(--c-ink);
    border-radius: var(--r-full);
    padding: 8px 14px;
    font-size: var(--fs-label);
    font-weight: 700;
    white-space: nowrap;
}

/* ---- pills (customer: touch target >= 44px) ---- */

.c-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 14px 16px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
    background: var(--c-card);
    color: var(--c-ink);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.c-pill-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* ---- sticky contact bar (FR-10: plain links only) ---- */

.c-sticky-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 12px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.c-sticky-inner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--c-card);
    border-radius: var(--r-xxl);
    padding: 12px;
    box-shadow: var(--shadow-sticky);
    width: calc(100% - 28px);
    max-width: 452px; /* 480 minus shell padding */
}

.c-whatsapp-pill {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 14px 16px;
    border-radius: var(--r-full);
    background: var(--c-positive);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.c-call-button {
    inline-size: 48px;
    block-size: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-full);
    background: var(--c-black);
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
}

/* ---- error (invalid payload) ---- */

.c-error-glyph { font-size: 3rem; text-align: center; }
.c-error-title { font-size: 1.25rem; font-weight: 700; text-align: center; margin: 8px 0 4px; }
.c-error-body { color: var(--c-muted); text-align: center; }

/* ---- focus ring (mandatory; never outline:none) ---- */

.customer-shell a:focus-visible,
.customer-shell button:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

/* ---- Filter card (story 1.5): dashed progress, states, order pill ---- */
.c-filter-title { font-size: 1.125rem; font-weight: 700; margin: 0 0 14px; color: var(--c-ink); }
.c-filter-bar {
    position: relative; height: 14px; border-radius: 999px;
    border: 1px solid var(--c-border);
    /* dashed remainder; no overflow:hidden so the black marker can stand proud */
    background: repeating-linear-gradient(-45deg, var(--c-surface-muted) 0 6px, var(--c-card) 6px 12px);
}
.c-filter-fill {
    position: absolute; inset-block: 0; inset-inline-start: 0;
    background: var(--c-primary); border-radius: 999px; max-width: 100%;
}
.c-filter-overdue .c-filter-fill { background: var(--c-alert); }
.c-filter-marker { position: absolute; inset-block: -2px; width: 3px; background: var(--c-black); border-radius: 2px; }
.c-filter-edges { display: flex; justify-content: space-between; margin-block-start: 8px; font-size: 0.8125rem; color: var(--c-muted); }
.c-filter-status { margin-block-start: 14px; font-size: 1rem; font-weight: 600; color: var(--c-ink); }
.c-filter-status.c-alert-text { color: var(--c-alert-text); }
.c-filter-order {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 24px; margin-block-start: 14px;
    border-radius: 999px; background: var(--c-primary); color: #fff; font-weight: 700; text-decoration: none;
}
.c-filter-approaching .c-filter-order, .c-filter-overdue .c-filter-order { background: var(--c-alert); }
.c-filter-order:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 3px; }

/* ---- Fault card (story 1.6): orange bar, circle icon, numbered steps ---- */
.c-fault { border-block-start: 4px solid var(--c-alert); }
.c-fault-head { display: flex; align-items: flex-start; gap: 12px; }
.c-fault-icon {
    flex: 0 0 auto; inline-size: 32px; block-size: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-alert); color: #fff; font-weight: 800; font-size: 1.125rem;
}
.c-fault-headings { min-inline-size: 0; }
.c-fault-title { font-size: 1.125rem; font-weight: 700; margin: 0; color: var(--c-ink); }
.c-fault-time { font-size: 0.8125rem; color: var(--c-muted); margin: 4px 0 0; }
.c-fault-explain { margin: 12px 0 0; font-size: 0.95rem; color: var(--c-ink); line-height: 1.5; } /* managed explanation (3.5) */
.c-fault-steps { margin: 14px 0 0; padding-inline-start: 1.25rem; display: flex; flex-direction: column; gap: 8px; }
.c-fault-steps li { font-size: 0.95rem; color: var(--c-ink); line-height: 1.45; }
.c-fault-cta {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 24px; margin-block-start: 16px;
    border-radius: 999px; background: var(--c-alert); color: #fff; font-weight: 700; text-decoration: none;
}
.c-fault-cta:focus-visible { outline: 2px solid var(--c-alert); outline-offset: 3px; }

/* ---- Guide card (story 1.7): PDF icon, view/download pills ---- */
.c-guide-head { display: flex; align-items: center; gap: 12px; }
.c-guide-icon {
    flex: 0 0 auto; inline-size: 44px; block-size: 44px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-primary-tint); color: var(--c-primary); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.02em;
}
.c-guide-meta { min-inline-size: 0; }
.c-guide-title { font-size: 1.0625rem; font-weight: 700; margin: 0; color: var(--c-ink); }
.c-guide-sub { font-size: 0.8125rem; color: var(--c-muted); margin: 3px 0 0; }
.c-guide-actions { display: flex; gap: 10px; margin-block-start: 16px; }
.c-guide-pill {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-ink);
    font-weight: 700; text-decoration: none;
}
.c-guide-pill-download { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.c-guide-pill:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* ---- Landing page (story 1.9): centered brand card ---- */
.c-landing { min-block-size: 70vh; display: flex; align-items: center; justify-content: center; }
.c-landing-card { text-align: center; padding: 32px 24px; width: 100%; }
.c-landing-logo { font-size: 3.25rem; line-height: 1; margin-block-end: 8px; }
.c-landing-title { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--c-ink); }
.c-landing-prompt { font-size: 1rem; color: var(--c-muted); margin: 0 0 22px; line-height: 1.5; }
.c-landing-cta { display: inline-flex; width: auto; min-width: 220px; margin-inline: auto; }
.c-landing-site { display: inline-block; margin-block-start: 16px; color: var(--c-primary); font-weight: 600; text-decoration: none; }
.c-landing-site:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
