/* ============================================================
   CF7 Multi-Step OTP — Stylesheet
   Compatible with Astra, GeneratePress, Hello Elementor,
   Blocksy, Kadence, OceanWP
   ============================================================ */

/* ── Progress bar ── */
.cf7ms-progress-wrap {
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.cf7ms-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ── Step dots ── */
.cf7ms-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.cf7ms-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: background 0.3s, transform 0.2s;
    display: inline-block;
}
.cf7ms-dot-done   { background: #10b981; }
.cf7ms-dot-active { background: #2563eb; transform: scale(1.25); }

/* ── Step label ── */
.cf7ms-step-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 20px;
}

/* ── Step show/hide ── */
.cf7ms-step    { display: none; }
.cf7ms-active  { display: block; animation: cf7msFadeIn 0.22s ease; }

@keyframes cf7msFadeIn {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Field label ── */
.cf7ms-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.cf7ms-req { color: #ef4444; }

/* ── Phone row ── */
.cf7ms-phone-row {
    display: flex;
    align-items: stretch;
}
.cf7ms-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-right: none;
    border-radius: 8px 0 0 8px;
    user-select: none;
    white-space: nowrap;
}
.cf7ms-phone-input {
    flex: 1;
    padding: 10px 13px !important;
    font-size: 15px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0 8px 8px 0 !important;
    outline: none !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.cf7ms-phone-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
}

/* ── Buttons ── */
.cf7ms-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
    line-height: 1.4;
    text-decoration: none;
}
.cf7ms-btn:active  { transform: scale(0.97); }
.cf7ms-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.cf7ms-btn-primary {
    background: #2563eb;
    color: #fff;
    margin-top: 8px;
}
.cf7ms-btn-primary:hover:not(:disabled) { background: #1d4ed8; opacity: 1; }

.cf7ms-btn-verify {
    display: block;
    width: 100%;
    justify-content: center;
    background: #059669;
    color: #fff;
    margin-top: 10px;
    padding: 11px 22px;
}
.cf7ms-btn-verify:hover:not(:disabled) { background: #047857; opacity: 1; }

.cf7ms-btn-next {
    background: #2563eb;
    color: #fff;
}
.cf7ms-btn-next:hover:not(:disabled) { background: #1d4ed8; opacity: 1; }

.cf7ms-btn-prev {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.cf7ms-btn-prev:hover { background: #f9fafb; color: #374151; opacity: 1; }

.cf7ms-arrow { transition: transform 0.15s; }
.cf7ms-btn:hover .cf7ms-arrow { transform: translateX(3px); }

/* ── Nav row (prev + next) ── */
.cf7ms-nav {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Link buttons (resend, change number) ── */
.cf7ms-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #2563eb;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: color 0.15s;
}
.cf7ms-link:hover { color: #1d4ed8; text-decoration: underline; }

/* ── OTP panel ── */
.cf7ms-otp-panel { margin-top: 14px; }

.cf7ms-otp-hint {
    font-size: 13px;
    color: #374151;
    margin: 0 0 12px;
}
.cf7ms-otp-hint strong { color: #111827; }

/* ── 6-digit boxes ── */
.cf7ms-digits {
    display: flex;
    gap: 9px;
    margin-bottom: 4px;
}
.cf7ms-digit {
    width: 48px !important;
    height: 54px !important;
    text-align: center !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #111827 !important;
    caret-color: transparent;
    box-sizing: border-box !important;
    line-height: 1 !important;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s !important;
}
.cf7ms-digit:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.14) !important;
    outline: none !important;
    transform: scale(1.06) !important;
}
.cf7ms-digit:not([value=""]) { border-color: #10b981 !important; }

/* Shake for wrong OTP */
@keyframes cf7msShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}
.cf7ms-shake { animation: cf7msShake 0.45s ease; }

/* ── OTP footer ── */
.cf7ms-otp-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.cf7ms-timer {
    font-size: 12px;
    color: #6b7280;
    min-width: 95px;
}

/* ── Verified badge ── */
.cf7ms-verified-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.cf7ms-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #d1fae5;
    color: #065f46;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #6ee7b7;
}

/* ── Error messages ── */
.cf7ms-error {
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
    min-height: 18px;
    margin: 6px 0 0;
    line-height: 1.4;
}

/* ── Invalid field highlight ── */
.cf7ms-invalid,
.cf7ms-invalid input,
.cf7ms-invalid select,
.cf7ms-invalid textarea {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239,68,68,0.12) !important;
}

/* ── CF7 field overrides for consistency ── */
.cf7ms-step .wpcf7-form-control:not([type="submit"]):not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 13px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    margin-bottom: 12px;
    color: #111827;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
}
.cf7ms-step .wpcf7-form-control:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
}
.cf7ms-step select.wpcf7-form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px !important;
    cursor: pointer;
}
.cf7ms-step textarea.wpcf7-form-control {
    resize: vertical;
    min-height: 90px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .cf7ms-digit  { width: 40px !important; height: 46px !important; font-size: 19px !important; }
    .cf7ms-digits { gap: 6px; }
    .cf7ms-nav    { flex-direction: column-reverse; }
    .cf7ms-btn-next, .cf7ms-btn-prev { width: 100%; justify-content: center; }
}
@media (max-width: 360px) {
    .cf7ms-digit  { width: 34px !important; height: 42px !important; font-size: 17px !important; }
    .cf7ms-digits { gap: 4px; }
}
