/* ============================================================
   CF7 WhatsApp OTP — Stylesheet
   WhatsApp green branding, compatible with all major themes
   ============================================================ */

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

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

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

/* ── Step panels ── */
.cf7wa-step    { display: none; }
.cf7wa-active  { display: block; animation: cf7waFade 0.22s ease; }

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

/* ── WhatsApp header banner ── */
.cf7wa-wa-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: #fff;
}
.cf7wa-wa-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.cf7wa-wa-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px;
    color: #fff;
}
.cf7wa-wa-sub {
    font-size: 12px;
    margin: 0;
    color: rgba(255,255,255,0.85);
}

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

/* ── Phone row ── */
.cf7wa-phone-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 12px;
}
.cf7wa-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;
    white-space: nowrap;
    user-select: none;
}
.cf7wa-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;
    box-sizing: border-box !important;
    width: 100% !important;
}
.cf7wa-phone-input:focus {
    border-color: #25D366 !important;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.15) !important;
}

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

/* Send OTP — WhatsApp green */
.cf7wa-btn-send {
    background: #25D366;
    color: #fff;
    width: 100%;
    margin-top: 2px;
    font-size: 15px;
    padding: 13px 22px;
}
.cf7wa-btn-send:hover:not(:disabled) { background: #1ebe5d; opacity: 1; }

.cf7wa-btn-icon-wa { font-size: 18px; line-height: 1; }

/* Verify — darker green */
.cf7wa-btn-verify {
    background: #128C7E;
    color: #fff;
    width: 100%;
    margin-top: 10px;
    padding: 11px 22px;
}
.cf7wa-btn-verify:hover:not(:disabled) { background: #0e7a6d; opacity: 1; }

/* Next — WhatsApp green */
.cf7wa-btn-next {
    background: #25D366;
    color: #fff;
}
.cf7wa-btn-next:hover:not(:disabled) { background: #1ebe5d; opacity: 1; }

/* Back — ghost */
.cf7wa-btn-prev {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.cf7wa-btn-prev:hover { background: #f9fafb; color: #374151; opacity: 1; }

/* ── Nav row ── */
.cf7wa-nav {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Link buttons ── */
.cf7wa-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #128C7E;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: color 0.15s;
}
.cf7wa-link:hover { color: #0e7a6d; text-decoration: underline; }

/* ── OTP sent info box ── */
.cf7wa-otp-sent-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.cf7wa-check-icon { font-size: 20px; flex-shrink: 0; }
.cf7wa-otp-sent-info p {
    margin: 0;
    font-size: 13px;
    color: #166534;
}
.cf7wa-otp-sent-info strong { color: #15803d; }

/* ── 6-digit OTP boxes ── */
.cf7wa-digits {
    display: flex;
    gap: 9px;
    margin-bottom: 4px;
}
.cf7wa-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;
}
.cf7wa-digit:focus {
    border-color: #25D366 !important;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.15) !important;
    outline: none !important;
    transform: scale(1.06) !important;
}
.cf7wa-digit:not([value=""]) { border-color: #25D366 !important; }

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

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

/* ── Verified badge ── */
.cf7wa-verified-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.cf7wa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dcfce7;
    color: #166534;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #86efac;
}

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

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

/* ── CF7 field styling inside steps ── */
.cf7wa-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;
}
.cf7wa-step .wpcf7-form-control:focus {
    border-color: #25D366 !important;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.12) !important;
}
.cf7wa-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;
}
.cf7wa-step textarea.wpcf7-form-control {
    resize: vertical;
    min-height: 90px;
}

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