/* =============================================================
   CF7 Secure Math Captcha  ·  v3.0
   Clean inline design — equation + input on one row
   ============================================================= */

.cf7sc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
}

.wpcf7 form>div, .wpcf7 form>p {
    margin-bottom: 0.8em;
}

/* ── Card ─────────────────────────────────────────────────── */
.cf7sc-card {
    background: #f0f4ff;
    border: 1.5px solid #dde5ff;
    border-radius: 10px;
    padding: 5px 10px 5px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: fit-content;
    height: 48px;
}

/* ── Top row: icon + label ────────────────────────────────── */
.cf7sc-card-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.cf7sc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #4f46e5;
    border-radius: 7px;
    color: #fff;
    flex-shrink: 0;
}

.cf7sc-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #6366f1;
}

/* ── Equation row ─────────────────────────────────────────── */
.cf7sc-equation-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cf7sc-question {
    font-size: 13px;
    font-weight: 500;
    color: #1e1b4b;
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Input ────────────────────────────────────────────────── */
.cf7sc-input-wrap {
    flex: 1;
    min-width: 56px;
    max-width: 56px;
}

.cf7sc-wrap span.cf7sc-error-tip {
    display: none !important;
}

.cf7sc-input-wrap input[type="number"]{
    border-radius: 10px !important;
    min-height: 36px !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    padding: 0 !important;
    height: 36px;
}

.cf7sc-answer {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 14px;
    font-size: 22px;
    font-weight: 700;
    color: #1e1b4b;
    text-align: center;
    background: #fff;
    border: 2px solid #c7d2fe;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease;

    /* hide browser spinners */
    -moz-appearance: textfield;
    appearance: textfield;
}

.cf7sc-answer::-webkit-inner-spin-button,
.cf7sc-answer::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cf7sc-answer::placeholder {
    color: #a5b4fc;
    font-weight: 400;
    font-size: 18px;
}

.cf7sc-answer:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .14);
}

/* ── Error / invalid state (set by JS + CF7 server response) ─ */
.cf7sc-answer.cf7sc-not-valid,
.cf7sc-answer.wpcf7-not-valid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .14) !important;
    animation: cf7sc-shake .35s ease;
}

@keyframes cf7sc-shake {
    0%, 100% { transform: translateX(0);    }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px);  }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px);  }
}

/* Inline error tip */
.cf7sc-error-tip {
    display: block;
    height: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
    margin-top: 0;
    transition: height .2s ease, margin-top .2s ease;
}

.cf7sc-error-tip--visible {
    height: auto;
    margin-top: 6px;
}

/* ── Honeypot ─────────────────────────────────────────────── */
.cf7sc-hp {
    position: absolute;
    left: -10000px;
    top: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 400px) {
    .cf7sc-question  { font-size: 13px; }
    .cf7sc-answer    { font-size: 18px; height: 44px; }
    .cf7sc-input-wrap { max-width: 100px; }
}

/* ── Dark mode ────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .cf7sc-card {
        background: #1e1b4b;
        border-color: #312e81;
    }

    .cf7sc-question { color: #e0e7ff; }
    .cf7sc-label    { color: #a5b4fc; }

    .cf7sc-answer {
        background: #13103a;
        color: #e0e7ff;
        border-color: #4338ca;
    }

    .cf7sc-answer::placeholder { color: #4338ca; }

    .cf7sc-answer:focus {
        border-color: #818cf8;
        box-shadow: 0 0 0 4px rgba(129, 140, 248, .18);
    }

    .cf7sc-answer.cf7sc-not-valid,
    .cf7sc-answer.wpcf7-not-valid {
        border-color: #f87171 !important;
        box-shadow: 0 0 0 4px rgba(248, 113, 113, .18) !important;
    }

    .cf7sc-error-tip { color: #f87171; }
}