:root {
    --cf-bg: #f5f7fa;
    --cf-card: #ffffff;
    --cf-border: #e2e8f0;
    --cf-ink: #1d1d1f;
    --cf-muted: #64748b;
    --cf-accent: #EB1000;
    --cf-accent-light: #ff3322;
    --cf-ok: #16a34a;
    --cf-err: #dc2626;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--cf-bg);
    color: var(--cf-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.cf__card {
    width: min(100%, 420px);
    background: var(--cf-card);
    border: 1px solid var(--cf-border);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    padding: 28px 24px 22px;
    text-align: center;
}

.cf__logo {
    width: 44px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
}

.cf__title {
    margin: 0 0 10px;
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cf__lead {
    margin: 0 0 22px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--cf-muted);
}

.cf__phase {
    animation: cf-fade-in 0.35s ease-out both;
}

@keyframes cf-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.cf__row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    max-width: 300px;
    padding: 14px 16px;
    border: 1px solid var(--cf-border);
    border-radius: 6px;
    background: #fafbfc;
    cursor: pointer;
    user-select: none;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.cf__row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}

.cf__row:focus-visible {
    border-color: var(--cf-accent);
    box-shadow: 0 0 0 3px rgba(235, 16, 0, 0.18);
}

.cf__row.is-checking {
    pointer-events: none;
    border-color: #fecaca;
    background: #fff5f5;
    animation: cf-row-pulse 1s ease-in-out infinite;
}

@keyframes cf-row-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(235, 16, 0, 0.12); }
    50% { box-shadow: 0 0 0 4px rgba(235, 16, 0, 0.1); }
}

.cf__row.is-busy {
    pointer-events: none;
    opacity: 0.55;
}

.cf__checkbox {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.cf__box {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: 2px solid #94a3b8;
    border-radius: 4px;
    background: #fff;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.cf__row:hover .cf__box {
    border-color: #64748b;
}

.cf__box-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid #fecaca;
    border-top-color: var(--cf-accent);
    border-radius: 50%;
    animation: cf-spin 0.65s linear infinite;
}

.cf__row.is-checking .cf__box {
    border-color: var(--cf-accent);
    background: #fff;
    transform: scale(1.05);
}

.cf__row.is-checking .cf__box-spinner {
    display: block;
}

.cf__checkbox:checked + .cf__box:not(.cf__box--done) {
    border-color: var(--cf-accent);
}

.cf__label {
    font-size: 0.9375rem;
    color: var(--cf-ink);
    transition: color 0.2s;
}

.cf__row.is-checking .cf__label {
    color: var(--cf-accent);
    font-weight: 500;
}

.cf__fine {
    margin: 18px 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.cf__phase--busy {
    padding: 8px 0 4px;
}

.cf__progress-wrap {
    width: 100%;
    max-width: 280px;
    height: 6px;
    margin: 0 auto 18px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.cf__progress-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cf-accent), var(--cf-accent-light));
    transition: none;
}

.cf__progress-bar.is-running {
    animation: cf-progress-fill var(--cf-verify-duration, 2s) ease-in-out forwards;
}

@keyframes cf-progress-fill {
    0% { width: 8%; }
    35% { width: 52%; }
    70% { width: 78%; }
    100% { width: 100%; }
}

.cf__busy-text {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--cf-muted);
}

.cf__dots::after {
    content: "";
    animation: cf-dots 1.4s steps(4, end) infinite;
}

@keyframes cf-dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
}

.cf__phase--ok {
    padding: 12px 0 4px;
}

.cf__ok-ring {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cf-ok-ring 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes cf-ok-ring {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.cf__ok-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cf-ok);
    color: #fff;
    font-size: 1.125rem;
    line-height: 36px;
    font-weight: 700;
    animation: cf-ok-pop 0.5s 0.15s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes cf-ok-pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.cf__ok-text {
    color: var(--cf-ink);
    font-weight: 600;
}

.cf__ok-sub {
    margin: 6px 0 0;
    font-size: 0.8125rem;
    color: var(--cf-muted);
}

.cf__error {
    margin: 16px 0 0;
    font-size: 0.875rem;
    color: var(--cf-err);
}

@keyframes cf-spin {
    to { transform: rotate(360deg); }
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .cf__phase,
    .cf__row.is-checking,
    .cf__progress-bar.is-running,
    .cf__ok-ring,
    .cf__ok-icon {
        animation: none !important;
    }
    .cf__progress-bar.is-running { width: 100%; }
}
