/**
 * TicketBNK — Mobile Validator App UI (vector HTML/CSS)
 * Design canvas: 390×844 — uniformly scaled into device viewport via JS.
 */

.mv2-hero-phones {
    position: relative;
    width: min(100%, 400px);
    height: 510px;
    margin-inline: auto;
    overflow: visible;
}

.mv2-hero-device-note {
    margin: 0.65rem 0 0;
    text-align: center;
    color: var(--mv-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.validator-device {
    --device-width: 360px;
    position: relative;
    width: var(--device-width);
    aspect-ratio: 390 / 844;
    margin: 0 auto;
    padding: 8px;
    border-radius: 38px;
    background: #111827;
    box-sizing: border-box;
    box-shadow:
        0 28px 64px rgba(15, 23, 42, 0.22),
        0 8px 24px rgba(15, 23, 42, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.validator-device__viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 30px;
    background: #fff;
}

/* Showcase: one device, stacked panels scaled together */
.showcase-stage {
    --validator-scale: 1;
    position: relative;
    width: 390px;
    height: 844px;
    transform: scale(var(--validator-scale));
    transform-origin: top left;
}

.showcase-panel.validator-app,
.hero-slide__app.validator-app {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(10px);
    transform-origin: top left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 200ms ease,
        transform 200ms ease,
        visibility 200ms ease;
}

.showcase-panel.validator-app.is-active,
.hero-slide__app.validator-app.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .showcase-panel.validator-app,
    .hero-slide__app.validator-app {
        transition: none;
        transform: none;
    }
}

/* Design canvas — JS sets --validator-scale = viewportWidth / 390 */
.validator-app {
    --va-blue: #1565c0;
    --va-pass: #43a047;
    --va-fail: #e53935;
    --va-warn: #fb8c00;
    --va-ink: #1e293b;
    --va-muted: #64748b;
    --va-line: #e2e8f0;
    --va-bg: #f7f8fa;
    --va-status: #0b1220;
    --validator-scale: 1;
    box-sizing: border-box;
    width: 390px;
    height: 844px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    overflow: hidden;
    background: #fff;
    color: var(--va-ink);
    font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    font-size: 14px;
    line-height: 1.35;
    transform: scale(var(--validator-scale));
    transform-origin: top left;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}

.validator-app *,
.validator-app *::before,
.validator-app *::after {
    box-sizing: border-box;
}

.validator-app--login {
    grid-template-rows: 1fr;
    background: #fff;
}

/* iOS-like status strip */
.validator-app__os {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 12px 18px 0;
    background: var(--va-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.validator-app--login .validator-app__os {
    background: #fff;
    color: #111;
}
.validator-app__os-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}
.validator-app__os-icons i {
    display: block;
    background: currentColor;
    opacity: 0.95;
}
.validator-app__os-icons .sig {
    width: 17px;
    height: 10px;
    clip-path: polygon(0 70%, 25% 70%, 25% 50%, 50% 50%, 50% 30%, 75% 30%, 75% 10%, 100% 10%, 100% 100%, 0 100%);
}
.validator-app__os-icons .wifi {
    width: 15px;
    height: 11px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    background: transparent !important;
}
.validator-app__os-icons .bat {
    width: 22px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    background: transparent !important;
    position: relative;
}
.validator-app__os-icons .bat::after {
    content: "";
    position: absolute;
    inset: 1.5px;
    background: currentColor;
}

.validator-app__header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 72px;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    background: var(--va-blue);
    color: #fff;
    font-weight: 700;
}
.validator-app__header-left { justify-self: start; }
.validator-app__header-title {
    justify-self: center;
    min-width: 0;
    font-size: 16px;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.validator-app__header-right {
    justify-self: end;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.validator-app__burger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 12px;
}
.validator-app__burger span {
    display: block;
    height: 2px;
    border-radius: 1px;
    background: #fff;
}
.validator-app__back {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(45deg);
    margin-left: 2px;
}

.validator-app__content {
    min-height: 0;
    overflow: hidden;
    background: var(--va-bg);
    display: flex;
    flex-direction: column;
}

.validator-app__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 0 14px;
    background: var(--va-status);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
}
.validator-app__status-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.validator-app__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}
.validator-app__dot.is-off { background: #ef4444; }
.validator-app__ok { color: #86efac; }
.validator-app__bad { color: #fecaca; }

/* Login */
.va-login {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 72px 28px 18px;
    background: #fff;
}
.va-login__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.va-login__logo {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}
.va-login__name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.va-login__name em { font-style: normal; color: var(--va-blue); }
.va-login__sub {
    margin: 0 0 36px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
}
.va-login__field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    margin-bottom: 12px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 14px;
    background: #fff;
}
.va-login__field svg { width: 18px; height: 18px; fill: #94a3b8; flex-shrink: 0; }
.va-login__field span { flex: 1; }
.va-login__check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 16px;
    font-size: 14px;
    color: var(--va-ink);
}
.va-login__box {
    width: 16px;
    height: 16px;
    border: 1.5px solid #94a3b8;
    border-radius: 3px;
}
.va-login__btn {
    display: grid;
    place-items: center;
    height: 48px;
    border-radius: 8px;
    background: var(--va-blue);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}
.va-login__copy {
    margin-top: auto;
    padding-bottom: 8px;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
}

/* Scan */
.va-scan {
    padding: 14px 14px 10px;
    gap: 12px;
    flex: 1;
    background: var(--va-bg);
}
.va-scan__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    width: 100%;
}
.va-scan__field label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--va-muted);
}
.va-scan__field {
    min-width: 0;
    width: 100%;
}
.va-scan__select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
}
.va-scan__select span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.va-scan__select::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    margin-top: -3px;
}
.va-scan__prompt {
    margin: 4px 0 0;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
}
.va-scan__box {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 88px;
    border: 1.5px solid var(--va-blue);
    border-radius: 10px;
    background: #fff;
}
.va-scan__kbd {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 28px;
    height: 22px;
    border-radius: 5px;
    background: #e2e8f0;
}
.va-scan__stats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 800;
}
.va-scan__refresh {
    width: 16px;
    height: 16px;
    border: 2px solid #94a3b8;
    border-top-color: transparent;
    border-radius: 50%;
}
.va-scan__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}
.va-scan__card {
    padding: 14px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--va-line);
}
.va-scan__card span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--va-muted);
}
.va-scan__card strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
    font-weight: 800;
}
.va-scan__card.is-blue strong { color: var(--va-blue); }
.va-scan__card.is-green strong { color: var(--va-pass); }
.va-scan__card.is-red strong { color: var(--va-fail); }
.va-scan__card.is-orange strong { color: var(--va-warn); }

/* Result */
.va-result {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.va-result__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px 24px;
    color: #fff;
    text-align: center;
}
.va-result__panel.is-pass { background: var(--va-pass); }
.va-result__panel.is-fail { background: var(--va-fail); }
.va-result__panel.is-warn { background: var(--va-warn); }
.va-result__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 22px;
    font-weight: 800;
}
.va-result__title { margin: 0; font-size: 22px; font-weight: 800; }
.va-result__desc { margin: 0; font-size: 13px; opacity: 0.95; }
.va-info {
    width: 100%;
    min-width: 0;
    padding: 16px 14px 8px;
}
.va-info h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 800;
}
.va-info__row {
    display: grid;
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--va-line);
    font-size: 13px;
}
.va-info__row dt { color: var(--va-muted); font-weight: 600; }
.va-info__row dd {
    margin: 0;
    min-width: 0;
    text-align: right;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.va-confirm {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: auto 0 14px;
    padding: 0;
    border: 1.5px solid var(--va-blue);
    border-radius: 8px;
    background: #fff;
    color: var(--va-blue);
    font-size: 15px;
    font-weight: 800;
}
.va-result > .va-confirm,
.va-result .va-confirm {
    width: calc(100% - 28px);
    margin-left: 14px;
    margin-right: 14px;
}

/* Network */
.va-net {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 18px 16px;
    background: #fff;
}
.va-net__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 16px;
    border-radius: 12px;
    background: #546e7a;
    color: #fff;
    text-align: center;
}
.va-net__panel strong { font-size: 18px; }
.va-net__panel p { margin: 0; font-size: 13px; opacity: 0.95; }
.va-net__wifi {
    width: 42px;
    height: 32px;
    border: 3px solid #fff;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    position: relative;
    margin-bottom: 4px;
}
.va-net__wifi::after {
    content: "×";
    position: absolute;
    right: -4px;
    bottom: -8px;
    font-size: 20px;
    font-weight: 800;
}
.va-net__btn {
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    height: 44px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
}
.va-net__btn.is-primary { background: var(--va-blue); color: #fff; }
.va-net__btn.is-outline {
    border: 1.5px solid var(--va-blue);
    color: var(--va-blue);
    background: #fff;
}
.va-net__note {
    margin: 4px auto 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--va-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* History */
.va-hist {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 12px 8px;
    background: #fff;
}
.va-hist__filters {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: 8px;
    width: 100%;
}
.va-hist__filters label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--va-muted);
}
.va-hist__input {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
}
.va-hist__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}
.va-hist__stat {
    padding: 8px 4px;
    border: 1px solid var(--va-line);
    border-radius: 8px;
    text-align: center;
    background: #fff;
}
.va-hist__stat span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--va-muted);
}
.va-hist__stat strong {
    display: block;
    margin-top: 3px;
    font-size: 14px;
    font-weight: 800;
}
.va-hist__stat.is-blue strong { color: var(--va-blue); }
.va-hist__stat.is-green strong { color: var(--va-pass); }
.va-hist__stat.is-red strong { color: var(--va-fail); }
.va-hist__stat.is-orange strong { color: var(--va-warn); }
.va-hist__table {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--va-line);
    border-radius: 8px;
    font-size: 11px;
    background: #fff;
}
.va-hist__table table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}
.va-hist__table col.col-time { width: 62px; }
.va-hist__table col.col-res { width: auto; }
.va-hist__table col.col-result { width: 54px; }
.va-hist__table col.col-gate { width: 62px; }
.va-hist__table th,
.va-hist__table td {
    min-width: 0;
    padding: 8px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.va-hist__table th {
    background: #f1f5f9;
    color: var(--va-muted);
    font-weight: 700;
}
.va-hist__table td {
    border-top: 1px solid var(--va-line);
    text-align: center;
    font-weight: 600;
}
.va-hist__table td:nth-child(2) {
    text-align: left;
    overflow-wrap: anywhere;
    white-space: normal;
}
.va-hist__ok { color: var(--va-pass); }
.va-hist__warn { color: var(--va-warn); }
.va-hist__fail { color: var(--va-fail); }
.va-hist__pager {
    display: flex;
    justify-content: center;
    gap: 5px;
}
.va-hist__page {
    min-width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--va-muted);
}
.va-hist__page.is-on {
    border-color: var(--va-blue);
    color: var(--va-blue);
}

/* Hero stack — Method A: real width, layout-aware parent height */
.mv2-hero-phones .validator-device {
    position: absolute;
    margin: 0;
}
.mv2-hero-phones .validator-device.is-back {
    --device-width: calc(var(--hero-device-width, 230px) * 0.76);
    left: 39%;
    top: 52%;
    transform: translate(-50%, -50%) rotate(-5deg);
    z-index: 1;
    opacity: 0.55;
    filter: blur(0.5px);
}
.mv2-hero-phones .validator-device.is-back-right {
    --device-width: calc(var(--hero-device-width, 230px) * 0.76);
    left: 61%;
    top: 52%;
    transform: translate(-50%, -50%) rotate(5deg);
    z-index: 1;
    opacity: 0.55;
    filter: blur(0.5px);
}
.mv2-hero-phones .validator-device.is-front {
    --device-width: var(--hero-device-width, 230px);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    opacity: 1;
    filter: none;
}
.validator-device--float {
    animation: mv2-phone-float 5.5s ease-in-out infinite;
}
@keyframes mv2-phone-float {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 6px)); }
}

@media (max-width: 1023px) {
    .mv2-hero-phones {
        height: 470px;
        width: min(100%, 380px);
    }
    .mv2-hero-phones .validator-device.is-back-right {
        display: none;
    }
}

@media (max-width: 767px) {
    .mv2-hero-phones {
        position: relative;
        height: calc(var(--hero-device-width, 215px) * 844 / 390);
        width: min(100%, 280px);
    }
    .mv2-hero-phones .validator-device.is-back,
    .mv2-hero-phones .validator-device.is-back-right {
        display: none;
    }
    .mv2-hero-phones .validator-device.is-front {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        --device-width: var(--hero-device-width, min(56vw, 215px));
        margin-inline: auto;
    }
    .validator-device--float {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .validator-device--float { animation: none; }
}


/* 390px history grid (preferred over wide desktop tables) */
.va-hist__grid {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 54px 62px;
    width: 100%;
    border-top: 1px solid var(--va-line);
}
.va-hist__table > .va-hist__grid:first-child {
    border-top: 0;
}
.va-hist__grid > * {
    min-width: 0;
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
}
.va-hist__grid > *:nth-child(2) {
    text-align: left;
    overflow-wrap: anywhere;
}
.va-hist__grid-head {
    background: #f1f5f9;
    color: var(--va-muted);
}
.va-hist__grid-head > * {
    font-weight: 700;
}
