/* DST contact form widget — styled to match the previous Elfsight widget. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 5px;
    background: var(--cf-background);
    color: var(--cf-text);
    font-family: var(--cf-font);
    font-size: var(--cf-font-size);
    line-height: 20px;
}

.cf-root {
    max-width: var(--cf-max-width);
    margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* Layout                                                             */
/* ------------------------------------------------------------------ */

.cf-form { display: flex; flex-wrap: wrap; gap: var(--cf-gap); }

.cf-field { display: block; flex: 1 1 100%; min-width: 0; }

/* Half-width fields sit two to a row (config width: 50). */
.cf-w50 { flex-basis: calc(50% - var(--cf-gap) / 2); }

@media (max-width: 480px) {
    .cf-w50 { flex-basis: 100%; }
}

.cf-form-error, .cf-actions, .cf-footer { flex-basis: 100%; }

/* Conditional fields start hidden; widget.js reveals them. */
.is-hidden { display: none !important; }

.cf-actions { display: flex; justify-content: center; }

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

/* ------------------------------------------------------------------ */
/* Labels, hints, errors                                              */
/* ------------------------------------------------------------------ */

.cf-label {
    display: block;
    margin-bottom: 6px;
    padding: 0;
    color: var(--cf-label);
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
}

.cf-req { color: var(--cf-label); font-weight: 600; }

.cf-hint {
    margin-top: 6px;
    color: var(--cf-hint);
    font-size: 13px;
    line-height: 17px;
}

.cf-error,
.cf-form-error {
    display: none;
    margin-top: 6px;
    color: var(--cf-error);
    font-size: 13px;
    line-height: 17px;
}

.cf-error.is-visible,
.cf-form-error.is-visible { display: block; }

.cf-form-error {
    margin-top: 0;
    padding: 10px 12px;
    border: 1px solid var(--cf-error);
    border-radius: var(--cf-radius);
    background: rgba(211, 47, 47, 0.06);
}

/* ------------------------------------------------------------------ */
/* Inputs                                                             */
/* ------------------------------------------------------------------ */

.cf-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    background: var(--cf-fill);
    color: var(--cf-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 20px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
}

.cf-input::placeholder { color: var(--cf-hint); }

.cf-input:focus {
    outline: none;
    border-color: var(--cf-accent);
    box-shadow: 0 0 0 2px rgba(14, 139, 37, 0.15);
}

.cf-input.has-error { border-color: var(--cf-error); }

.cf-textarea { min-height: 60px; resize: vertical; }

/* Select ------------------------------------------------------------ */

.cf-select-wrap { position: relative; }

.cf-select {
    padding-right: 36px;
    cursor: pointer;
    background-image: none;
}

.cf-select-arrow {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    color: var(--cf-text);
    pointer-events: none;
}

/* Radio choices ----------------------------------------------------- */

.cf-fieldset { margin: 0; padding: 0; border: 0; }

.cf-fieldset .cf-label { margin-bottom: 8px; }

.cf-choice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 15px;
    line-height: 20px;
}

.cf-choice input[type="radio"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--cf-accent);
    cursor: pointer;
}

.cf-other-input { margin-top: 8px; }

/* File upload ------------------------------------------------------- */

.cf-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 16px 12px;
    border: 1px dashed var(--cf-border);
    border-radius: var(--cf-radius);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cf-drop.is-dragover {
    border-color: var(--cf-accent);
    background: rgba(14, 139, 37, 0.05);
}

.cf-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cf-drop-link {
    color: var(--cf-accent);
    font-weight: 600;
    text-decoration: underline;
}

.cf-drop-text { color: var(--cf-hint); }

.cf-file-list { margin: 8px 0 0; padding: 0; list-style: none; }

.cf-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    font-size: 13px;
    line-height: 17px;
}

.cf-file-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-file-size { flex: 0 0 auto; color: var(--cf-hint); }

.cf-file-remove {
    flex: 0 0 auto;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--cf-hint);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.cf-file-remove:hover { color: var(--cf-error); }

/* ------------------------------------------------------------------ */
/* Decorative blocks                                                  */
/* ------------------------------------------------------------------ */

.cf-paragraph { font-size: 15px; line-height: 20px; }

.cf-paragraph ul { margin: 8px 0 0; padding-left: 20px; }

.cf-paragraph li { margin-bottom: 6px; }

.cf-callout {
    padding: 10px;
    border: 1px solid currentColor;
    border-radius: 5px;
}

.cf-messenger {
    display: block;
    padding: 7px;
    border-radius: 10px;
    background-color: var(--cf-messenger);
    color: #fff;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.cf-messenger:hover { filter: brightness(1.08); }

.cf-messenger-icon {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

.cf-heading {
    color: var(--cf-label);
    font-size: 17px;
    font-weight: 700;
    line-height: 22px;
}

.cf-caption {
    margin-top: 4px;
    color: var(--cf-hint);
    font-size: 13px;
    line-height: 18px;
}

/* ------------------------------------------------------------------ */
/* Submit                                                             */
/* ------------------------------------------------------------------ */

.cf-submit {
    padding: 13px 32px;
    border: 2px solid transparent;
    border-radius: var(--cf-btn-radius, var(--cf-radius));
    background-color: var(--cf-accent);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    line-height: 22px;
    cursor: pointer;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.cf-submit:hover:not(:disabled) { filter: brightness(1.08); }

.cf-submit:focus-visible {
    outline: 2px solid var(--cf-accent);
    outline-offset: 2px;
}

.cf-submit:disabled { opacity: 0.65; cursor: default; }

.cf-footer {
    margin-top: 4px;
    color: var(--cf-hint);
    font-size: 12px;
    line-height: 16px;
    text-align: center;
}

.cf-footer a { color: var(--cf-hint); }

/* ------------------------------------------------------------------ */
/* Success panel                                                      */
/* ------------------------------------------------------------------ */

.cf-success {
    padding: 32px 16px;
    text-align: center;
}

.cf-success-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: var(--cf-accent);
}

.cf-success-title {
    margin-bottom: 6px;
    font-size: 20px;
    font-weight: 700;
    line-height: 26px;
}

.cf-success-text { color: var(--cf-hint); font-size: 15px; line-height: 20px; }

/* ------------------------------------------------------------------ */
/* Reduced motion                                                     */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
