/* Key Factory Scan — WordPress Plugin
   Matches Figma export exactly: pill buttons, white cards, red #B92025, Plus Jakarta Sans
   ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Reset + scope ───────────────────────────────────────────────────────── */

.kf-widget,
.kf-widget * {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.kf-widget {
    /* Design tokens */
    --kf-red:          #B92025;
    --kf-red-dark:     #961b1f;
    --kf-red-light:    rgba(185,32,37,0.08);
    --kf-black:        #0d0d0d;
    --kf-dark:         #1a1a1a;
    --kf-muted:        #6b7280;
    --kf-border:       #e5e7eb;
    --kf-border-dark:  #d1d5db;
    --kf-bg:           #ffffff;
    --kf-bg-outer:     #F2F2F2;
    --kf-bg-card:      #f9fafb;
    --kf-radius-card:  18px;
    --kf-radius-btn:   999px;
    --kf-radius-input: 999px;
    --kf-shadow:       0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);

    background: var(--kf-bg);
    color: var(--kf-black);
    max-width: 480px;
    margin: 0 auto;
    border-radius: var(--kf-radius-card);
    overflow: hidden;
    box-shadow: var(--kf-shadow);
    border: 1px solid var(--kf-border);
}

/* ── Tabs (scan / track order) ───────────────────────────────────────────── */

.kf-tabs {
    display: flex;
    border-bottom: 1px solid var(--kf-border);
    background: var(--kf-bg);
}

.kf-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 12px;
    color: var(--kf-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 150ms, border-color 150ms;
    letter-spacing: 0.01em;
}

.kf-tab:hover { color: var(--kf-black); }

.kf-tab--active {
    color: var(--kf-red);
    border-bottom-color: var(--kf-red);
}

/* ── Panels ──────────────────────────────────────────────────────────────── */

.kf-panel { display: block; }
.kf-panel--hidden { display: none; }

/* ── Steps ───────────────────────────────────────────────────────────────── */

.kf-step { display: block; }
.kf-step--hidden { display: none; }

/* ── Progress bar ────────────────────────────────────────────────────────── */

.kf-progress {
    height: 4px;
    background: var(--kf-border);
    width: 100%;
}

.kf-progress-fill {
    height: 100%;
    background: var(--kf-red);
    border-radius: 0 2px 2px 0;
    transition: width 0.4s ease;
}

/* ── Step nav (Back / Step X of Y) ──────────────────────────────────────── */

.kf-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 0;
}

.kf-step-nav-back {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--kf-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 150ms;
}

.kf-step-nav-back:hover { color: var(--kf-black); }

.kf-step-nav-back svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.kf-step-nav-label {
    font-size: 14px;
    color: var(--kf-muted);
    font-weight: 500;
}

/* ── Content padding ─────────────────────────────────────────────────────── */

.kf-body {
    padding: 24px 20px 28px;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

.kf-heading {
    font-size: 26px;
    font-weight: 800;
    color: var(--kf-black);
    margin: 0 0 8px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.kf-subheading {
    font-size: 15px;
    color: var(--kf-muted);
    margin: 0 0 24px;
    line-height: 1.5;
    font-weight: 400;
}

/* ── How it works (welcome screen) ───────────────────────────────────────── */

.kf-howitworks {
    padding-top: 32px;
    text-align: left;
}

.kf-howitworks-hero {
    font-family: inherit;
    font-size: 32px;
    font-weight: 800;
    color: var(--kf-black);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0 0 12px;
}

.kf-howitworks-lede {
    font-size: 15px;
    color: var(--kf-muted);
    line-height: 1.55;
    margin: 0 0 24px;
    font-weight: 400;
}

.kf-howitworks-section {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--kf-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 32px 0 12px;
}

.kf-howitworks-steps {
    list-style: none;
    list-style-type: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kf-howitworks-steps li::marker {
    content: '';
    display: none;
}

.kf-howitworks-step {
    list-style: none;
    list-style-type: none;
    padding: 16px 18px 14px;
    background: var(--kf-bg);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-card);
}

.kf-howitworks-step::before {
    content: none;
}

.kf-howitworks-step-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--kf-red);
    margin: 0 0 2px;
    line-height: 1.2;
}

.kf-howitworks-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--kf-black);
    margin: 0 0 6px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.kf-howitworks-desc {
    font-size: 13px;
    color: var(--kf-muted);
    margin: 0;
    line-height: 1.5;
}

.kf-trust-badges {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.kf-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--kf-muted);
}

.kf-trust-badge svg {
    width: 14px;
    height: 14px;
    fill: var(--kf-red);
    flex-shrink: 0;
}

/* ── Key type selector (How it works screen) ─────────────────────────────── */

.kf-keytype-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.kf-keytype-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 2px solid var(--kf-border);
    border-radius: var(--kf-radius-card);
    background: var(--kf-bg);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 150ms, background 150ms;
    text-align: center;
}

.kf-keytype-btn svg {
    width: 28px;
    height: 28px;
    fill: var(--kf-muted);
    transition: fill 150ms;
}

.kf-keytype-btn span {
    font-size: 14px;
    font-weight: 700;
    color: var(--kf-black);
}

.kf-keytype-btn small {
    font-size: 11px;
    color: var(--kf-muted);
    font-weight: 400;
    line-height: 1.3;
}

.kf-keytype-btn--active {
    border-color: var(--kf-red);
    background: var(--kf-red-light);
}

.kf-keytype-btn--active svg { fill: var(--kf-red); }

/* ── Tips screen — compact heading variants + need help link ─────────────── */

.kf-heading--sm {
    font-size: 22px;
    margin-bottom: 4px;
}

.kf-subheading--tight {
    margin-bottom: 16px;
}

.kf-need-help-row {
    text-align: center;
    margin: 14px 0 0;
}

.kf-need-help-row a {
    font-size: 14px;
    font-weight: 600;
    color: var(--kf-muted);
    text-decoration: none;
}

.kf-need-help-row a:hover { color: var(--kf-black); }

/* ── Tip cards (before we scan) ──────────────────────────────────────────── */

.kf-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.kf-tip-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--kf-bg);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-card);
    gap: 12px;
}

.kf-tip-card-text { flex: 1; }

.kf-tip-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--kf-black);
    margin: 0 0 2px;
}

.kf-tip-card-desc {
    font-size: 13px;
    color: var(--kf-muted);
    margin: 0;
}

.kf-tip-card-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kf-red);
}

.kf-tip-card-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--kf-red);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.kf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    border-radius: var(--kf-radius-btn);
    border: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms, border-color 150ms, opacity 150ms;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: 0.01em;
}

.kf-btn + .kf-btn { margin-top: 10px; }

.kf-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

.kf-btn--primary {
    background: var(--kf-red);
    color: #fff;
}

.kf-btn--primary:hover { background: var(--kf-red-dark); }

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

.kf-btn--ghost {
    background: transparent;
    color: var(--kf-black);
    border: 1.5px solid var(--kf-border-dark);
}

.kf-btn--ghost:hover { border-color: #9ca3af; background: #f9fafb; }

.kf-btn--ghost-sm {
    font-size: 14px;
    padding: 12px 20px;
}

/* ── File input (hidden, triggered by button) ────────────────────────────── */

.kf-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* ── Camera viewfinder ───────────────────────────────────────────────────── */

.kf-viewfinder-wrap {
    position: relative;
    background: #111;
    border-radius: var(--kf-radius-card);
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 4 / 3;
}

.kf-viewfinder-wrap video,
.kf-viewfinder-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Captured stills show the WHOLE photo (letterboxed), not a crop. The live
   video keeps `cover` for framing, but iOS Safari anchors video and img
   cover-crops differently — after capture the visible window jumped and the
   key (and its scan outline) could sit outside it entirely. `contain` is
   device-independent: what you captured is what you see. */
.kf-viewfinder-wrap img#kf-preview-current {
    object-fit: contain;
}

.kf-viewfinder-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255,255,255,0.45);
    font-size: 14px;
    font-weight: 500;
}

.kf-viewfinder-placeholder svg {
    width: 36px;
    height: 36px;
    fill: rgba(255,255,255,0.35);
}

/* Corner bracket guides */
.kf-frame-guides {
    position: absolute;
    inset: 16px;
    pointer-events: none;
}

.kf-frame-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #fff;
    border-style: solid;
    opacity: 0.85;
}

.kf-frame-corner--tl { top:0; left:0; border-width:3px 0 0 3px; border-radius:3px 0 0 0; }
.kf-frame-corner--tr { top:0; right:0; border-width:3px 3px 0 0; border-radius:0 3px 0 0; }
.kf-frame-corner--bl { bottom:0; left:0; border-width:0 0 3px 3px; border-radius:0 0 0 3px; }
.kf-frame-corner--br { bottom:0; right:0; border-width:0 3px 3px 0; border-radius:0 0 3px 0; }

/* ── Front / Back toggle ─────────────────────────────────────────────────── */

.kf-side-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.kf-side-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--kf-radius-btn);
    border: 1.5px solid var(--kf-border);
    background: var(--kf-bg-card);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--kf-muted);
    cursor: pointer;
    transition: all 150ms;
}

.kf-side-btn--active {
    background: var(--kf-dark);
    border-color: var(--kf-dark);
    color: #fff;
}

.kf-side-btn--done {
    border-color: var(--kf-border);
    color: var(--kf-muted);
}

.kf-side-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kf-side-check svg {
    width: 12px;
    height: 12px;
    fill: #fff;
}

.kf-side-empty {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.4;
    flex-shrink: 0;
}

/* ── Captured thumbnails (keycode step) ──────────────────────────────────── */

.kf-thumb-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.kf-thumb {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.kf-thumb img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--kf-radius-card);
    border: 1px solid var(--kf-border);
    background: var(--kf-bg-card);
}

.kf-thumb span {
    font-size: 12px;
    font-weight: 600;
    color: var(--kf-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Key code field ──────────────────────────────────────────────────────── */

.kf-field {
    margin-bottom: 20px;
}

.kf-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--kf-black);
    margin-bottom: 8px;
}

.kf-field-optional {
    font-weight: 400;
    color: var(--kf-muted);
    margin-left: 4px;
}

.kf-input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--kf-border);
    border-radius: var(--kf-radius-input);
    background: var(--kf-bg);
    color: var(--kf-black);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    transition: border-color 150ms;
    -webkit-appearance: none;
    appearance: none;
}

.kf-input:focus {
    outline: none;
    border-color: var(--kf-dark);
}

.kf-input::placeholder { color: #9ca3af; }

.kf-field-hint {
    font-size: 12px;
    color: var(--kf-muted);
    margin: 6px 0 0;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */

.kf-or {
    text-align: center;
    font-size: 14px;
    color: var(--kf-muted);
    margin: 14px 0;
}

/* ── Processing ──────────────────────────────────────────────────────────── */

.kf-processing-body {
    padding: 32px 20px 28px;
    text-align: center;
}

/* Orbiting dots (matches Figma exactly) */
.kf-dots-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
}

.kf-dot {
    position: absolute;
    border-radius: 50%;
    background: var(--kf-red);
    animation: kf-orbit 1.4s ease-in-out infinite;
}

.kf-dot:nth-child(1) { width:12px; height:12px; top:0;    left:50%; margin-left:-6px;  animation-delay:0s; }
.kf-dot:nth-child(2) { width: 8px; height: 8px; top:15%;  right:5%;                     animation-delay:0.1s; }
.kf-dot:nth-child(3) { width: 6px; height: 6px; top:50%;  right:0;  margin-top:-3px;   animation-delay:0.2s; }
.kf-dot:nth-child(4) { width: 8px; height: 8px; bottom:15%; right:5%;                  animation-delay:0.3s; }
.kf-dot:nth-child(5) { width:10px; height:10px; bottom:0;  left:50%; margin-left:-5px;  animation-delay:0.4s; }
.kf-dot:nth-child(6) { width: 7px; height: 7px; bottom:15%; left:5%;                   animation-delay:0.5s; }
.kf-dot:nth-child(7) { width: 9px; height: 9px; top:50%;  left:0;   margin-top:-4.5px; animation-delay:0.6s; }
.kf-dot:nth-child(8) { width: 6px; height: 6px; top:15%;  left:5%;                     animation-delay:0.7s; }

@keyframes kf-orbit {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.3; transform: scale(0.6); }
}

.kf-processing-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--kf-black);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.kf-processing-sub {
    font-size: 14px;
    color: var(--kf-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}

/* Reassurance card */
.kf-reassure-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--kf-bg);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-card);
    text-align: left;
    gap: 12px;
}

.kf-reassure-card-text { flex: 1; }

.kf-reassure-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--kf-black);
    margin: 0 0 2px;
}

.kf-reassure-card-desc {
    font-size: 13px;
    color: var(--kf-muted);
    margin: 0;
    line-height: 1.4;
}

.kf-reassure-card-icon {
    width: 36px;
    height: 36px;
    background: var(--kf-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kf-reassure-card-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* ── Step nav label variants ─────────────────────────────────────────────── */

.kf-step-nav-label--success {
    color: #16a34a;
    font-weight: 600;
    font-size: 13px;
}

.kf-step-nav-label--warn {
    color: #d97706;
    font-weight: 600;
    font-size: 13px;
}

/* ── Result ──────────────────────────────────────────────────────────────── */

.kf-result-body {
    padding: 24px 20px 28px;
}

/* Matched blank card */
.kf-result-key-card {
    background: var(--kf-bg);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-card);
    overflow: hidden;
    margin-bottom: 18px;
}

.kf-result-key-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 24px 20px;
}

.kf-result-key-img-wrap img {
    max-height: 130px;
    max-width: 100%;
    object-fit: contain;
}

.kf-result-key-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--kf-muted);
    font-size: 14px;
    font-weight: 500;
}

.kf-result-key-placeholder svg {
    width: 52px;
    height: 52px;
    fill: var(--kf-border-dark);
}

/* Key name + price row */
.kf-result-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.kf-result-title-text { flex: 1; min-width: 0; }

.kf-result-key-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--kf-black);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kf-result-key-sub {
    font-size: 14px;
    color: var(--kf-muted);
    margin: 0;
}

.kf-result-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--kf-black);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Quantity selector */
.kf-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.kf-qty-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--kf-black);
}

.kf-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kf-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--kf-red);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms, opacity 150ms;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.kf-qty-btn:hover:not(:disabled) { background: var(--kf-red-dark); }

.kf-qty-btn:disabled {
    background: var(--kf-border);
    cursor: not-allowed;
}

.kf-qty-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.kf-qty-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--kf-black);
    min-width: 28px;
    text-align: center;
    line-height: 1;
}

/* ID notice */
.kf-id-notice {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--kf-muted);
    margin: 0 0 16px;
    font-weight: 500;
    line-height: 1.4;
}

.kf-id-notice svg {
    width: 16px;
    height: 16px;
    fill: var(--kf-muted);
    flex-shrink: 0;
}

/* Divider */
.kf-result-divider {
    height: 1px;
    background: var(--kf-border);
    margin: 16px 0;
}

/* Technical details toggle */
.kf-tech-details {
    border-top: 1px solid var(--kf-border);
    padding-top: 14px;
    margin-top: 16px;
}

.kf-tech-toggle {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--kf-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: left;
    transition: color 150ms;
}

.kf-tech-toggle:hover { color: var(--kf-black); }

.kf-tech-toggle-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 200ms;
    margin-left: auto;
    flex-shrink: 0;
}

.kf-tech-toggle[aria-expanded="true"] .kf-tech-toggle-icon {
    transform: rotate(180deg);
}

.kf-tech-body {
    margin-top: 14px;
}

/* Technical detail rows */
.kf-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.kf-result-label {
    font-size: 14px;
    color: var(--kf-muted);
}

.kf-result-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--kf-black);
}

.kf-result-value--code {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    color: var(--kf-red);
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* Confidence */
.kf-confidence-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kf-confidence-bar-track {
    flex: 1;
    height: 6px;
    background: var(--kf-border);
    border-radius: 99px;
    overflow: hidden;
    min-width: 80px;
}

.kf-confidence-bar {
    height: 100%;
    background: var(--kf-red);
    border-radius: 99px;
    transition: width 0.6s ease-out;
}

.kf-confidence-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--kf-black);
    min-width: 36px;
    text-align: right;
}

/* ── Uncertain / options ─────────────────────────────────────────────────── */

.kf-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.kf-option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--kf-bg);
    border: 1.5px solid var(--kf-border);
    border-radius: var(--kf-radius-card);
    cursor: pointer;
    transition: border-color 150ms, background 150ms;
    gap: 12px;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.kf-option-card:hover {
    border-color: var(--kf-red);
    background: var(--kf-red-light);
}

.kf-option-card--selected {
    border-color: var(--kf-red);
    background: var(--kf-red-light);
}

.kf-option-card-text { flex: 1; min-width: 0; }

.kf-option-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--kf-black);
    margin: 0 0 3px;
}

.kf-option-card-conf {
    font-size: 13px;
    color: var(--kf-muted);
    margin: 0;
}

.kf-option-card-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    color: var(--kf-red);
    opacity: 0.55;
}

.kf-option-card-icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.kf-uncertain-divider {
    margin-top: 20px;
}

/* ── ID note (legacy alias) ──────────────────────────────────────────────── */
.kf-id-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--kf-muted);
    margin: 12px 0 0;
}

/* ── Error ───────────────────────────────────────────────────────────────── */

.kf-error-body {
    padding: 24px 20px 28px;
}

/* ── Need help ───────────────────────────────────────────────────────────── */

.kf-need-help {
    text-align: center;
    padding: 16px 0 4px;
    font-size: 14px;
    color: var(--kf-red);
    font-weight: 500;
}

/* ── Order form ──────────────────────────────────────────────────────────── */

.kf-order-body {
    padding: 24px 20px 28px;
}

/* ── Order result ────────────────────────────────────────────────────────── */

.kf-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kf-status--placed      { background: #eff6ff; color: #1d4ed8; }
.kf-status--processing  { background: #fff7ed; color: #c2410c; }
.kf-status--dispatched  { background: #f0fdf4; color: #15803d; }
.kf-status--delivered   { background: #dcfce7; color: #15803d; }
.kf-status--cancelled   { background: #fee2e2; color: #b91c1c; }
.kf-status--refunded    { background: #f5f3ff; color: #7c3aed; }
.kf-status--unknown     { background: #f3f4f6; color: #6b7280; }

/* ── Error box ───────────────────────────────────────────────────────────── */

.kf-error-alert {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: var(--kf-radius-card);
    padding: 16px 18px;
    font-size: 14px;
    color: #b91c1c;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ── Responsive — desktop widens card ───────────────────────────────────── */

@media (min-width: 640px) {
    .kf-widget {
        max-width: 520px;
    }

    .kf-heading { font-size: 30px; }

    .kf-btn { font-size: 16px; padding: 16px 28px; }
}

@media (min-width: 1024px) {
    /* On desktop, allow a two-column layout if embedded in a wide container */
    .kf-widget--wide {
        max-width: 900px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .kf-widget--wide .kf-tabs {
        grid-column: 1 / -1;
    }
}

/* ── Scan-line overlay (capture screen) ─────────────────────────────────
   Canvas laid over the captured photo in the viewfinder. JS sweeps a red
   scan line across the key, drawing its detected outline and plotting the
   cut points as the line passes — same effect as the homepage video. */
.kf-scan-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    z-index: 2;
}

/* ── Key Safe (My Account) — black vault panel per the design PDF ────────── */

.kf-ks-panel {
    background: #0d0d0d;
    color: #f5f5f5;
    border-radius: 22px;
    padding: 28px 30px 22px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 8px 0 24px;
}
.kf-ks-title {
    color: #B92025;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}
.kf-ks-rule { border: none; border-top: 1px solid rgba(255,255,255,0.18); margin: 0 0 18px; }
.kf-ks-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kf-ks-head-right { display: flex; align-items: center; gap: 12px; }
.kf-ks-accent { color: #e0474c; font-weight: 700; }
.kf-ks-muted { color: rgba(255,255,255,0.62); font-size: 14px; margin: 4px 0 10px; }
.kf-ks-desc { margin: 2px 0 6px; font-size: 0.92em; color: #e8e8e8; font-style: italic; }
.kf-ks-lede { margin: 0 0 16px; font-size: 15px; }
.kf-ks-card--dark {
    background: #161616;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 16px;
    padding: 16px 18px;
    max-width: 420px;
}
.kf-ks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.kf-ks-grid .kf-ks-card--dark { max-width: none; }
.kf-ks-key-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kf-ks-keyicon { width: 26px; height: 26px; fill: #B92025; flex-shrink: 0; }
.kf-ks-actions { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.kf-ks-link {
    background: none; border: none; padding: 0; cursor: pointer;
    color: #e0474c; font-size: 14px; font-weight: 600;
    text-decoration: underline; font-family: inherit;
}
.kf-ks-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: #B92025; color: #fff !important;
    border: none; border-radius: 999px; cursor: pointer;
    font-family: inherit; font-size: 15px; font-weight: 700;
    padding: 12px 26px; text-decoration: none;
    transition: background 150ms;
}
.kf-ks-btn:hover { background: #961b1f; color: #fff; }
.kf-ks-btn--wide { width: 100%; margin-top: 10px; }
.kf-ks-btn--small { padding: 8px 18px; font-size: 13px; }
.kf-ks-btn--ghost {
    background: #fff; color: #0d0d0d !important;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 8px 18px; font-size: 13px;
}
.kf-ks-btn--ghost:hover { background: #eee; color: #0d0d0d; }
.kf-ks-btn--add { margin: 4px 0 14px; }
.kf-ks-btn--add svg { width: 20px; height: 20px; fill: #fff; }
.kf-ks-inline { display: inline; }
.kf-ks-input {
    width: 100%; box-sizing: border-box;
    background: #fff; color: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.3); border-radius: 12px;
    padding: 11px 14px; font-family: inherit; font-size: 15px;
    margin: 6px 0 4px;
}
.kf-ks-gate { max-width: 420px; }
.kf-ks-details { display: inline-block; }
.kf-ks-details summary { list-style: none; display: inline; }
.kf-ks-details summary::-webkit-details-marker { display: none; }
.kf-ks-details[open] { display: block; margin-top: 6px; }
.kf-ks-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; font-size: 13px; margin: 8px 0 4px; }
.kf-ks-dl dt { color: rgba(255,255,255,0.55); }
.kf-ks-dl dd { margin: 0; }
.kf-ks-rename { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.kf-ks-footnote { color: rgba(255,255,255,0.45); font-size: 12.5px; margin: 10px 0 0; }
.kf-ks-footnote strong { color: rgba(255,255,255,0.65); }
.kf-ks-panel--promo { padding: 22px 24px; }

/* ── Security-key product fields (single product page) ───────────────────── */
.kf-sec-fields {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px;
    margin: 0 0 18px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.kf-sec-note { font-size: 14px; color: #374151; margin: 0 0 14px; }
.kf-sec-note strong { color: #0d0d0d; }
.kf-sec-field { margin: 0 0 12px; }
.kf-sec-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.kf-sec-field .required { color: #B92025; }
.kf-sec-field input[type=text],
.kf-sec-field select {
    width: 100%; box-sizing: border-box;
    border: 1px solid #d1d5db; border-radius: 999px;
    padding: 10px 16px; font-family: inherit; font-size: 15px;
}
.kf-sec-status { display: block; font-size: 13px; color: #15803d; margin-top: 4px; }
.kf-sec-handling { font-size: 12.5px; color: #6b7280; margin: 10px 0 0; }
.kf-sec-handling strong { color: #B92025; }
