:root {
    --kfm-accent: #D38013;
    --kfm-dark: #27272a;
    --kfm-gray: #e6e6e8;
    --kfm-gray-2: #f6f6f7;
    --kfm-text: #33343a;
    --kfm-border: #d7d7dc;
    --kfm-radius: 22px;
}

.kfm-wrap,
.kfm-admin-wrap {
    color: var(--kfm-text);
}

.kfm-wrap {
    max-width: 1050px;
    margin: 0 auto;
    font-family: inherit;
}

.kfm-hero {
    background: linear-gradient(135deg, var(--kfm-accent), #3a3a3d);
    color: #fff;
    border-radius: var(--kfm-radius);
    padding: clamp(28px, 5vw, 56px);
    margin-bottom: 24px;
    box-shadow: 0 18px 50px rgba(0,0,0,.12);
}

.kfm-hero h2 {
    color: #fff;
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 56px);
    line-height: .98;
    text-transform: uppercase;
    letter-spacing: -.04em;
}

.kfm-hero p {
    margin: 0;
    color: #fff;
}

.kfm-eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 13px;
    opacity: .9;
    margin-bottom: 10px !important;
}

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

.kfm-condition-card,
.kfm-card,
.kfm-admin-card {
    background: var(--kfm-gray-2);
    border: 1px solid var(--kfm-border);
    border-radius: var(--kfm-radius);
    padding: clamp(18px, 3vw, 28px);
}

.kfm-condition-card h3,
.kfm-card h3,
.kfm-admin-card h2 {
    margin-top: 0;
    color: var(--kfm-dark);
    text-transform: uppercase;
    letter-spacing: -.02em;
}

.kfm-condition-card h3:before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 14px solid var(--kfm-accent);
    margin-right: 10px;
    transform: translateY(2px);
}

.kfm-condition-card ul {
    margin: 0;
    padding-left: 18px;
}

.kfm-condition-card li {
    margin-bottom: 6px;
}

.kfm-condition-wide {
    grid-column: 1 / -1;
    background: var(--kfm-gray);
    color: var(--kfm-dark);
    padding: 16px 22px;
    border-radius: 14px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
}

.kfm-form {
    display: grid;
    gap: 20px;
}

.kfm-grid {
    display: grid;
    gap: 16px;
}

.kfm-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kfm-form label,
.kfm-admin-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 14px;
}

.kfm-form input[type="text"],
.kfm-form input[type="email"],
.kfm-form input[type="url"],
.kfm-form input[type="number"],
.kfm-form input[type="date"],
.kfm-form select,
.kfm-form textarea,
.kfm-admin-form input[type="text"],
.kfm-admin-form input[type="email"],
.kfm-admin-form input[type="url"],
.kfm-admin-form input[type="number"],
.kfm-admin-form input[type="date"],
.kfm-admin-form select,
.kfm-admin-form textarea,
.kfm-admin-search input {
    width: 100%;
    border: 1px solid var(--kfm-border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--kfm-text);
    font-size: 16px;
    box-sizing: border-box;
    margin-top: 6px;
}

.kfm-form input:focus,
.kfm-form select:focus,
.kfm-form textarea:focus,
.kfm-admin-form input:focus,
.kfm-admin-form textarea:focus,
.kfm-admin-search input:focus {
    outline: 2px solid rgba(211,128,19,.25);
    border-color: var(--kfm-accent);
}

.kfm-checkline {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 600 !important;
}

.kfm-checkline input {
    margin-top: 4px;
    width: auto !important;
}

.kfm-previous-load {
    display: none;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--kfm-border);
}

.kfm-previous-box.is-open .kfm-previous-load {
    display: block;
}

.kfm-price-box {
    margin-top: 12px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--kfm-border);
    border-radius: 14px;
    font-size: 20px;
}

.kfm-price-box strong {
    color: var(--kfm-accent);
}

.kfm-button,
.wp-core-ui .kfm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 13px 24px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.kfm-button:hover {
    transform: translateY(-1px);
}

.kfm-button-primary {
    background: var(--kfm-accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(211,128,19,.28);
}

.kfm-button-secondary {
    background: var(--kfm-dark);
    color: #fff;
}

.kfm-signature-box {
    background: #fff;
    border: 2px dashed var(--kfm-border);
    border-radius: 18px;
    overflow: hidden;
    touch-action: none;
    margin-bottom: 12px;
}

.kfm-signature-canvas {
    display: block;
    width: 100%;
    height: 220px;
    cursor: crosshair;
}

.kfm-small {
    font-size: 13px;
    color: #666b75;
    margin: 8px 0 0;
}

.kfm-notice {
    border-radius: 16px;
    padding: 16px 18px;
    margin: 18px 0;
    font-weight: 700;
}

.kfm-success {
    background: #e7f7ed;
    border: 1px solid #a8dfbb;
    color: #175b2d;
}

.kfm-error {
    background: #fff1f1;
    border: 1px solid #ffc3c3;
    color: #8d1b1b;
}

.kfm-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.kfm-stat-card {
    background: #fff;
    border: 1px solid var(--kfm-border);
    border-left: 6px solid var(--kfm-accent);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 20px rgba(0,0,0,.04);
}

.kfm-stat-card span {
    display: block;
    font-size: 34px;
    font-weight: 900;
    color: var(--kfm-accent);
    margin-bottom: 8px;
}

.kfm-admin-card {
    margin: 20px 0;
    max-width: 1100px;
}

.kfm-admin-form .kfm-grid {
    margin-bottom: 14px;
}

.kfm-admin-search {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0;
    max-width: 680px;
}

.kfm-admin-search input {
    margin-top: 0;
}

.kfm-admin-table td,
.kfm-admin-table th {
    vertical-align: top;
}

.kfm-inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kfm-inline-form select {
    max-width: 240px;
}

.kfm-shortcodes {
    background: #fff;
    border: 1px solid var(--kfm-border);
    border-radius: 18px;
    padding: 22px;
}

@media (max-width: 760px) {
    .kfm-conditions,
    .kfm-grid-2 {
        grid-template-columns: 1fr;
    }

    .kfm-hero {
        border-radius: 18px;
    }

    .kfm-signature-canvas {
        height: 180px;
    }

    .kfm-admin-search,
    .kfm-inline-form {
        flex-direction: column;
        align-items: stretch;
    }
}

.kfm-price-tax {
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    color: #666a73;
    font-weight: 700;
}

.kfm-contract-preview {
    margin-top: 18px;
    background: #fff;
    border: 1px solid var(--kfm-border);
    border-radius: 14px;
    padding: 14px 16px;
}

.kfm-contract-preview summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--kfm-dark);
}

.kfm-contract-preview-inner {
    margin-top: 14px;
    color: var(--kfm-text);
}

.kfm-contract-preview-inner h4 {
    margin: 16px 0 8px;
    color: var(--kfm-dark);
}

.kfm-contract-preview-inner ul {
    margin: 0 0 8px 18px;
}

.kfm-wrap *,
.kfm-admin-wrap * {
    box-sizing: border-box;
}

.kfm-card,
.kfm-previous-load,
.kfm-price-box,
.kfm-contract-preview {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.kfm-checkline span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kfm-button,
.wp-core-ui .kfm-button {
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

.kfm-price-box > div {
    margin: 4px 0;
}

.kfm-price-total {
    padding-top: 8px;
    margin-top: 8px !important;
    border-top: 1px solid var(--kfm-border);
}

@media (max-width: 760px) {
    .kfm-wrap {
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
        overflow-x: hidden;
    }

    .kfm-card,
    .kfm-condition-card,
    .kfm-admin-card {
        padding: 18px;
        border-radius: 18px;
    }

    .kfm-previous-load .kfm-button,
    .kfm-form > .kfm-button {
        width: 100%;
    }

    .kfm-price-box {
        font-size: 17px;
        padding: 14px;
    }

    .kfm-price-tax {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}

.kfm-wrap,
.kfm-admin-wrap {
    box-sizing: border-box;
}
