:root {
    --kcdf-accent: #00565f;
    --kcdf-accent-dark: #003f46;
    --kcdf-text: #183238;
    --kcdf-muted: #64748b;
    --kcdf-border: #e5edf0;
    --kcdf-soft: #f7fbfc;
    --kcdf-white: #ffffff;
}

.kcdf-wrap {
    max-width: 920px;
    margin: 40px auto;
    padding: 0 18px;
    font-family: inherit;
}

.kcdf-form {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--kcdf-border);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(0, 86, 95, 0.12);
    padding: clamp(24px, 4vw, 46px);
    color: var(--kcdf-text);
}

.kcdf-header {
    text-align: center;
    margin-bottom: 26px;
}

.kcdf-eyebrow {
    color: var(--kcdf-accent);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin: 0 0 8px;
}

.kcdf-header h2 {
    margin: 0 0 10px;
    color: var(--kcdf-text);
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
}

.kcdf-header p {
    color: var(--kcdf-muted);
    max-width: 680px;
    margin: 0 auto;
}

.kcdf-progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 28px 0 34px;
}

.kcdf-progress span {
    height: 8px;
    border-radius: 999px;
    background: #dce8eb;
    overflow: hidden;
}

.kcdf-progress span.active {
    background: linear-gradient(90deg, var(--kcdf-accent), #0096a5);
}

.kcdf-step {
    display: none;
    animation: kcdfFade 0.25s ease;
}

.kcdf-step.active {
    display: block;
}

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

.kcdf-step h3 {
    font-size: 1.35rem;
    margin: 0 0 22px;
    color: var(--kcdf-text);
}

.kcdf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.kcdf-form label,
.kcdf-form legend {
    font-weight: 700;
    color: var(--kcdf-text);
}

.kcdf-form label span {
    color: var(--kcdf-muted);
    font-weight: 500;
}

.kcdf-form input[type="text"],
.kcdf-form input[type="email"],
.kcdf-form input[type="tel"],
.kcdf-form input[type="date"],
.kcdf-form textarea {
    width: 100%;
    margin-top: 8px;
    border: 1px solid var(--kcdf-border);
    border-radius: 16px;
    background: var(--kcdf-soft);
    padding: 13px 15px;
    font: inherit;
    color: var(--kcdf-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.kcdf-form textarea {
    resize: vertical;
}

.kcdf-form input:focus,
.kcdf-form textarea:focus {
    border-color: var(--kcdf-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 86, 95, 0.12);
}

.kcdf-full {
    display: block;
    margin-top: 20px;
}

.kcdf-form fieldset {
    border: 1px solid var(--kcdf-border);
    border-radius: 20px;
    padding: 18px;
    margin: 18px 0;
    background: linear-gradient(180deg, #ffffff, var(--kcdf-soft));
}

.kcdf-form fieldset label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0;
    font-weight: 600;
    color: #334155;
}

.kcdf-form input[type="radio"],
.kcdf-form input[type="checkbox"] {
    accent-color: var(--kcdf-accent);
    margin-top: 3px;
}

.kcdf-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 28px;
}

.kcdf-btn {
    border: 0;
    border-radius: 999px;
    padding: 14px 24px;
    background: var(--kcdf-accent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0, 86, 95, 0.22);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.kcdf-btn:hover {
    background: var(--kcdf-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(0, 86, 95, 0.26);
}

.kcdf-secondary {
    background: #e8f2f4;
    color: var(--kcdf-accent);
    box-shadow: none;
}

.kcdf-secondary:hover {
    background: #d9ecef;
    color: var(--kcdf-accent-dark);
    box-shadow: none;
}

.kcdf-message {
    display: none;
    margin-top: 20px;
    border-radius: 16px;
    padding: 14px 16px;
    font-weight: 700;
}

.kcdf-message.success {
    display: block;
    background: #ecfdf5;
    color: #047857;
}

.kcdf-message.error {
    display: block;
    background: #fef2f2;
    color: #b91c1c;
}

.kcdf-next-step,
.kcdf-warning {
    border-radius: 18px;
    padding: 18px;
    margin-top: 22px;
    background: #f2f8f9;
    border: 1px solid #d8eaed;
    color: #31575e;
}

.kcdf-turnstile {
    margin-top: 22px;
}

.kcdf-btn.loading {
    pointer-events: none;
    opacity: 0.72;
}

.kcdf-btn.loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
    vertical-align: -2px;
    animation: kcdfSpin 0.8s linear infinite;
}

@keyframes kcdfSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
    .kcdf-grid {
        grid-template-columns: 1fr;
    }

    .kcdf-actions {
        flex-direction: column-reverse;
    }

    .kcdf-btn {
        width: 100%;
    }

    .kcdf-form {
        border-radius: 22px;
    }
}


.kcdf-success-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

.kcdf-success-overlay.active {
    display: flex !important;
}

.kcdf-success-box {
    background: #ffffff !important;
    width: 100% !important;
    max-width: 460px !important;
    border-radius: 22px !important;
    padding: 34px 28px !important;
    text-align: center !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25) !important;
    animation: kcdfPopIn 0.25s ease-out !important;
}

.kcdf-success-icon {
    width: 72px !important;
    height: 72px !important;
    margin: 0 auto 18px !important;
    border-radius: 50% !important;
    background: #00565f !important;
    color: #ffffff !important;
    font-size: 42px !important;
    line-height: 72px !important;
    font-weight: 700 !important;
}

.kcdf-success-box h3 {
    margin: 0 0 10px !important;
    font-size: 26px !important;
    color: #00565f !important;
}

.kcdf-success-box p {
    margin: 0 0 24px !important;
    font-size: 17px !important;
    line-height: 1.5 !important;
    color: #333 !important;
}

@keyframes kcdfPopIn {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
