/*!
 * EasyOps homepage animations
 *  - .eo-paper  : paper log vs EasyOps (problem section)
 *  - .eo-sites  : same checks at every site (consistency section)
 * Partials: templates/partials/_home_paper_demo.html.twig, _home_sites_demo.html.twig
 * Script:   public/js/eo-home-anim.js
 */
.eo-paper,
.eo-sites {
    --a-ink: #1E2A4A;
    --a-muted: #6B7590;
    --a-line: #E7EBF2;
    --a-green: #1E8A57;
    --a-green-bg: #E6F4EC;
    --a-red: #D93A47;
    --a-red-bg: #FDECEE;
    --a-amber: var(--eo-amber, #FFC000);
    --a-amber-bg: #FFF6D6;
    --a-amber-text: var(--eo-amber-text, #8A6100);
    direction: ltr;
    text-align: left;
    font-family: inherit;
}

/* Screen-reader-only text (doesn't rely on Bootstrap's version) */
.eo-anim-sr {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important; border: 0 !important;
}

/* ════════════════ Paper vs EasyOps ════════════════ */
.eo-paper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    position: relative;          /* keeps the hidden caption out of the grid */
    max-width: 920px;
    margin: 0 auto;
}
.eo-paper__side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.eo-paper__kicker {
    font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--a-muted);
}
.eo-paper__side:last-child .eo-paper__kicker { color: var(--a-amber-text); }

/* Sheet */
.eo-paper__sheet {
    position: relative;
    overflow: hidden;
    padding: 18px 20px 22px;
    background: #FFFDF5;
    border: 1px solid #EEE6CF;
    border-radius: 6px;
    box-shadow: 0 1px 0 #EEE6CF, 0 14px 30px rgba(60, 45, 10, .08);
    transform: rotate(-1.2deg);
}
.eo-paper__sheet-head {
    font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #8C8165; padding-bottom: 10px; border-bottom: 2px solid #E4DBC2;
}
.eo-paper__row {
    display: grid;
    grid-template-columns: 76px auto 1fr;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border-bottom: 1px solid #ECE4CD;
    font-size: 14px;
    color: #6F6650;
}
.eo-paper__pen { font-style: italic; font-weight: 600; color: #34488C; font-size: 15px; }
.eo-paper__pen.is-smudged { filter: blur(1.4px); opacity: .8; }
.eo-paper__blank { display: inline-block; width: 46px; border-bottom: 1.5px dashed #CFC5A8; height: 12px; }
.eo-paper__tag {
    position: relative; z-index: 1;
    justify-self: end;
    font-size: 12px; font-weight: 700; white-space: nowrap;
    padding: 4px 10px; border-radius: 999px;
    background: var(--a-red-bg); color: var(--a-red);
    opacity: 0; transform: scale(.85);
    transition: opacity .35s ease, transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
.eo-paper__tag.is-on { opacity: 1; transform: none; }
.eo-paper__ring {
    position: absolute; left: 34%; bottom: -58px;
    width: 96px; height: 96px; border-radius: 50%;
    border: 7px solid rgba(140, 90, 30, .14);
    box-shadow: inset 0 0 0 3px rgba(140, 90, 30, .06);
    pointer-events: none;
}

/* Arrow */
.eo-paper__arrow { display: flex; justify-content: center; align-self: center; padding-top: 24px; }
.eo-paper__arrow span {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--a-amber); color: #1A1200;
    font-size: 20px; font-weight: 700;
    box-shadow: 0 6px 16px rgba(255, 170, 0, .35);
}

/* App card */
.eo-paper__app {
    background: #fff;
    border: 1px solid var(--a-line);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(30, 42, 74, .08);
    padding: 16px 18px 14px;
}
.eo-paper__app-head {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 700; color: var(--a-ink);
    padding-bottom: 8px;
}
.eo-paper__count {
    font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
    background: #E3EDFB; color: #2F6FD6; font-variant-numeric: tabular-nums;
}
.eo-paper__item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    border-top: 1px solid var(--a-line);
}
.eo-paper__item-main { display: flex; flex-direction: column; min-width: 0; }
.eo-paper__item-main b { font-size: 13.5px; color: var(--a-ink); font-weight: 600; }
.eo-paper__val { font-size: 12.5px; color: var(--a-muted); opacity: 0; transition: opacity .3s ease; }
.eo-paper__photo {
    font-style: normal; font-size: 10.5px; font-weight: 600;
    padding: 1px 6px; border-radius: 4px; margin-left: 4px;
    background: var(--a-line); color: var(--a-ink);
}
.eo-paper__meta { display: grid; justify-items: end; }
.eo-paper__meta > * { grid-area: 1 / 1; }
.eo-paper__duepill,
.eo-paper__stamp { font-size: 11.5px; white-space: nowrap; opacity: 0; transition: opacity .25s ease; }
.eo-paper__duepill { font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--a-amber-bg); color: var(--a-amber-text); }
.eo-paper__stamp { color: var(--a-muted); font-variant-numeric: tabular-nums; }

/* Shared status dot (paper app + sites) */
.eo-paper__dot,
.eo-site__dot {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: 20px; height: 20px; border-radius: 50%;
    border: 1.5px solid #CBD2DF;
    background: #fff;
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.eo-paper__dot::after,
.eo-site__dot::after {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; line-height: 1; color: #fff;
}
.is-due .eo-paper__dot { border-color: var(--a-amber); box-shadow: 0 0 0 4px var(--a-amber-bg); }
.is-done .eo-paper__dot,
.is-done .eo-site__dot { background: var(--a-green); border-color: var(--a-green); transform: scale(1.05); }
.is-done .eo-paper__dot::after,
.is-done .eo-site__dot::after { content: "✓"; }
.is-miss .eo-site__dot { background: var(--a-red); border-color: var(--a-red); }
.is-miss .eo-site__dot::after { content: "✕"; font-size: 10px; }

.eo-paper__item.is-due .eo-paper__duepill { opacity: 1; }
.eo-paper__item.is-done .eo-paper__stamp,
.eo-paper__item.is-done .eo-paper__val { opacity: 1; }

.eo-paper__foot {
    margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--a-line);
    font-size: 12px; font-weight: 600; color: var(--a-green);
    opacity: 0; transition: opacity .4s ease;
}
.eo-paper__foot::before { content: "✓ "; }
.eo-paper__foot.is-on { opacity: 1; }

/* ════════════════ Same checks at every site ════════════════ */
.eo-sites { max-width: 980px; margin: 0 auto; }
.eo-sites__clock {
    display: flex; align-items: center; gap: 12px;
    max-width: 560px; margin: 0 auto 24px;
    font-size: 12.5px; color: var(--a-muted);
}
.eo-sites__time { min-width: 66px; font-weight: 700; color: var(--a-ink); font-variant-numeric: tabular-nums; }
.eo-sites__track { position: relative; flex: 1; height: 4px; border-radius: 99px; background: var(--a-line); }
.eo-sites__track > span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--a-amber); }
.eo-sites__track > span::after {
    content: ""; position: absolute; right: -7px; top: 50%;
    width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
    background: #fff; border: 3px solid var(--a-amber);
}
.eo-sites__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    transition: opacity .35s ease;
}
.eo-sites.is-fading .eo-sites__grid,
.eo-sites.is-fading .eo-sites__summary { opacity: .35; }

.eo-site {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--a-line);
    border-radius: 16px;
    padding: 16px 18px 16px;
    box-shadow: 0 10px 30px rgba(30, 42, 74, .06);
    transition: border-color .3s ease, box-shadow .3s ease;
}
.eo-site.has-miss { border-color: #F2B8BE; box-shadow: 0 0 0 4px var(--a-red-bg), 0 10px 30px rgba(30, 42, 74, .06); }
.eo-site__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.eo-site__name { font-size: 15px; font-weight: 700; color: var(--a-ink); }
.eo-site__pct { font-size: 20px; font-weight: 800; color: var(--a-ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.eo-site__checks { list-style: none; margin: 0 0 14px; padding: 0; }
.eo-site__checks li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    border-bottom: 1px dashed var(--a-line);
}
.eo-site__lbl { font-size: 13px; color: var(--a-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eo-site__stamp { font-size: 11.5px; color: var(--a-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.eo-site__checks li.is-miss .eo-site__stamp { color: var(--a-red); font-weight: 700; }
.eo-site__bar { height: 6px; border-radius: 99px; background: var(--a-line); overflow: hidden; }
.eo-site__bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--a-green); transition: width .4s ease; }

.eo-sites__summary {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px;
    width: fit-content; max-width: 100%;
    margin: 22px auto 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--a-line);
    font-size: 14px; color: var(--a-ink);
    transition: opacity .35s ease;
}
.eo-sites__summary b { font-variant-numeric: tabular-nums; }
.eo-sites__summary-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--a-muted); }
.eo-sites__warn {
    font-size: 12.5px; font-weight: 700; color: var(--a-red);
    padding: 3px 10px; border-radius: 999px; background: var(--a-red-bg);
    opacity: 0; transition: opacity .3s ease;
}
.eo-sites__warn.is-on { opacity: 1; }

/* ════════════════ Responsive ════════════════ */
@media (max-width: 767px) {
    .eo-paper { grid-template-columns: minmax(0, 1fr); max-width: 420px; gap: 4px; }
    .eo-paper__arrow { padding: 10px 0; }
    .eo-paper__arrow span { transform: rotate(90deg); }
    .eo-paper__sheet { transform: rotate(-.6deg); }

    .eo-sites__grid { grid-template-columns: minmax(0, 1fr); max-width: 440px; margin: 0 auto; gap: 10px; }
    /* Compact cards: name · dots · % on one line, bar under it */
    .eo-site { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 12px 14px; }
    .eo-site__head { display: contents; }
    .eo-site__name { grid-column: 1; grid-row: 1; font-size: 14px; }
    .eo-site__pct { grid-column: 3; grid-row: 1; font-size: 16px; }
    .eo-site__checks { grid-column: 2; grid-row: 1; display: flex; gap: 6px; margin: 0; }
    .eo-site__checks li { display: block; min-height: 0; border: 0; }
    .eo-site__dot { width: 16px; height: 16px; }
    .eo-site__dot::after { font-size: 10px; }
    .eo-site__lbl, .eo-site__stamp { display: none; }
    .eo-site__bar { grid-column: 1 / -1; margin-top: 6px; }
    .eo-sites__summary { border-radius: 14px; font-size: 13px; }
}

/* Reduced motion: JS shows the final frame; also drop transitions */
@media (prefers-reduced-motion: reduce) {
    .eo-paper *, .eo-sites * { transition: none !important; }
}
