/*
 * Discovery-call request form — shared across all DataFlux pages.
 * Rendered by src/lead-form.js into any [data-dataflux-lead-form] container.
 *
 * Tokens are declared with fallbacks because each page carries its own
 * inline :root block and a few older pages predate the shared palette.
 */

.df-form {
    --df-black: var(--black, #0a0a0a);
    --df-white: var(--white, #fafafa);
    --df-line: var(--gray-100, #e5e5e5);
    --df-muted: var(--gray-400, #737373);
    --df-accent: var(--accent, #3b82f6);
    --df-danger: #dc2626;
    --df-ok: var(--success, #22c55e);

    font-family: var(--font-sans, 'DM Sans', -apple-system, sans-serif);
    max-width: 720px;
    text-align: left;
}

.df-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}

.df-field--wide {
    grid-column: 1 / -1;
}

.df-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.df-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--df-black);
}

.df-field label .df-opt {
    font-weight: 400;
    color: var(--df-muted);
}

.df-field input[type='text'],
.df-field input[type='email'],
.df-field input[type='url'],
.df-field select,
.df-field textarea {
    width: 100%;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--df-black);
    background: #fff;
    border: 1px solid var(--gray-200, #d4d4d4);
    border-radius: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.df-field select {
    /* Native arrow is removed by appearance:none — draw our own. */
    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 1.5L6 6.5L11 1.5' stroke='%23737373' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}

.df-field textarea {
    min-height: 104px;
    resize: vertical;
}

.df-field input:focus,
.df-field select:focus,
.df-field textarea:focus {
    outline: none;
    border-color: var(--df-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.df-field[data-invalid='true'] input,
.df-field[data-invalid='true'] select,
.df-field[data-invalid='true'] textarea {
    border-color: var(--df-danger);
}

.df-field__err {
    font-size: 0.75rem;
    color: var(--df-danger);
    min-height: 0;
}

.df-checks {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding: 14px 16px;
    background: var(--gray-50, #f5f5f5);
    border: 1px solid var(--df-line);
    border-radius: 4px;
}

.df-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--gray-600, #404040);
    cursor: pointer;
}

.df-check input[type='checkbox'] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--df-accent);
    cursor: pointer;
}

.df-check--consent {
    grid-column: 1 / -1;
    width: 100%;
    font-size: 0.8125rem;
    color: var(--df-muted);
}

.df-check--consent a {
    color: var(--gray-600, #404040);
    text-decoration: underline;
}

.df-form__foot {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
}

.df-submit {
    padding: 13px 26px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--df-white);
    background: var(--df-black);
    border: 1px solid var(--df-black);
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.df-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    opacity: 0.9;
}

.df-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.df-alt {
    font-size: 0.875rem;
    color: var(--df-muted);
}

.df-alt a {
    color: var(--gray-600, #404040);
    text-decoration: underline;
}

.df-form__err {
    grid-column: 1 / -1;
    font-size: 0.875rem;
    color: var(--df-danger);
}

.df-form__err:empty {
    display: none;
}

/* Honeypot — off-screen rather than display:none, which some bots skip. */
.df-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.df-done {
    display: none;
    padding: 26px 28px;
    background: var(--gray-50, #f5f5f5);
    border: 1px solid var(--df-line);
    border-left: 3px solid var(--df-ok);
    border-radius: 4px;
    max-width: 720px;
    text-align: left;
}

.df-done.is-visible {
    display: block;
}

.df-done h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--df-black);
}

.df-done p {
    margin: 0 0 10px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-600, #404040);
}

.df-done p:last-child {
    margin-bottom: 0;
}

.df-done a {
    color: var(--df-accent);
    font-weight: 600;
}

/* Slot kept for a future Cal.com / SavvyCal embed. Hidden until a
   booking URL is set via data-calendar-url on the form container. */
.df-calendar {
    display: none;
    margin-top: 32px;
}

.df-calendar.is-visible {
    display: block;
}

.df-calendar iframe {
    width: 100%;
    min-height: 640px;
    border: 1px solid var(--df-line);
    border-radius: 4px;
}

@media (max-width: 640px) {
    .df-form__grid {
        grid-template-columns: 1fr;
    }

    .df-submit {
        width: 100%;
    }

    .df-form__foot {
        gap: 12px;
    }
}
