@charset "UTF-8";

/**
 * Contact Form 7 styling.
 * Shared structure uses live theme tokens; hosting blocks own contextual colours.
 */

/* ==========================================================================
   Form Container
   ========================================================================== */

.wpcf7 {
    max-width: 420px;
    margin: 0 auto;
    padding: var(--space-4, 1rem);
}

.wpcf7 form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
}

/* ==========================================================================
   Form Paragraphs & Labels
   ========================================================================== */

.wpcf7 p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
}

.wpcf7 .adst-form-row {
    display: grid;
    gap: var(--space-4, 1rem);
    grid-template-columns: minmax(0, 1fr);
}

.wpcf7 .adst-form-row > p,
.wpcf7 .adst-form-row label {
    min-width: 0;
    width: 100%;
}

.wpcf7 label {
    font-family: var(--adst-font-family, "Montserrat", sans-serif);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 600;
    color: var(--adst-text, #111117);
    line-height: 1.5;
    display: block;
}

.wpcf7 label br {
    display: none; /* Remove <br> from labels for cleaner layout */
}

/* ==========================================================================
   Form Inputs & Textarea
   ========================================================================== */

.wpcf7-form-control-wrap {
    display: block;
    position: relative;
    width: 100%;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--adst-font-family, "Montserrat", sans-serif);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 400;
    color: var(--adst-text, #111117);
    background-color: var(--adst-surface, #fff);
    border: 1px solid var(--wp--preset--color--light);
    border-radius: 0;
    outline: none;
    transition: all 220ms ease;
    box-sizing: border-box;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 input[type="number"]:focus,
.wpcf7 input[type="date"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 20%, transparent);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Textarea specific */
.wpcf7 textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Date input specific */
.wpcf7 input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.wpcf7 input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 220ms ease;
}

.wpcf7 input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Select dropdown specific */
.wpcf7 select {
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="%23111117" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

/* Placeholder styling */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
    color: var(--adst-muted, #6D7076);
    opacity: 0.6;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.wpcf7 p:has(input[type="submit"]),
.wpcf7 p:has(.wpcf7-submit) {
    align-items: center;
}

/* Submit typography, shape, colours and states share the CTA rule in components.css. */

/* ==========================================================================
   Validation & Error Messages
   ========================================================================== */

/* Invalid fields retain the host block's accessible boundary colour. */
.wpcf7-form-control.wpcf7-not-valid {
    border-color: currentColor;
    box-shadow: none;
}

/* Error message below field */
.wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.5rem;
    font-size: var(--wp--preset--font-size--small);
    font-weight: var(--adst-font-semibold);
    color: var(--adst-primary);
    line-height: 1.4;
}

/* General response output (success/error messages) */
.wpcf7-response-output {
    margin-top: 0;
    margin-bottom: var(--space-4, 1rem);
    padding: var(--space-4, 1rem) var(--space-6, 1.5rem);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: var(--adst-font-semibold);
    line-height: 1.6;
    border-radius: 0;
    border-left: 4px solid;
    order: -1; /* Position above submit button */
}

.wpcf7-response-output[aria-hidden="true"] {
    display: none;
}

/* CF7 6.x puts submission status on the form, not the response element. */
.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output,
.wpcf7-form.sent .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output {
    display: block;
    height: auto;
    opacity: 1;
    overflow: visible;
    visibility: visible;
}

/* Error response */
.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output {
    color: #8B0000;
    background-color: rgb(var(--adst-primary-rgb) / 0.1);
    border-left-color: var(--adst-primary);
}

/* Success response */
.wpcf7-form.sent .wpcf7-response-output {
    color: #155724;
    background-color: #d4edda;
    border-left-color: #28a745;
}

/* Required acceptance response */
.wpcf7-form.unaccepted .wpcf7-response-output {
    color: #856404;
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.wpcf7 .wpcf7-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 0.75rem;
    vertical-align: middle;
    border: 3px solid rgb(var(--adst-primary-rgb) / 0.2);
    border-top-color: var(--adst-primary);
    border-radius: 50%;
    animation: wpcf7-spin 0.8s linear infinite;
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease;
}

.wpcf7-form.submitting .wpcf7-spinner {
    opacity: 1;
    visibility: visible;
}

@keyframes wpcf7-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Screen Reader Text
   ========================================================================== */

.wpcf7 .screen-reader-response {
    position: absolute;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    word-wrap: normal !important;
}

/* ==========================================================================
   Acceptance Checkbox (GDPR/Terms)
   ========================================================================== */

.wpcf7 .wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.wpcf7 .wpcf7-acceptance input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    cursor: pointer;
    flex-shrink: 0;
}

.wpcf7 .wpcf7-list-item {
    margin: 0;
}

.wpcf7 .wpcf7-list-item-label {
    font-weight: 400;
    font-size: var(--wp--preset--font-size--medium);
    line-height: 1.6;
    cursor: pointer;
}

.wpcf7 .wpcf7-acceptance a {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

/* Consent gate hint (#40) — says why the submit is inactive while it is disabled. */
.adst-consent-hint {
    color: var(--adst-text, #111827); /* Full-strength body text, not a muted grey: #38 fixed that contrast class. */
    font-family: var(--adst-font-family, "Montserrat", sans-serif);
    font-size: var(--wp--preset--font-size--small);
    font-weight: var(--adst-font-semibold, 600);
    line-height: 1.5;
}

/* The hint lives in the submit's flex column, which sets display on its children. */
.adst-consent-hint[hidden] {
    display: none;
}

/* ==========================================================================
   Quiz/CAPTCHA Fields
   ========================================================================== */

.wpcf7 .wpcf7-quiz-label,
.wpcf7 .wpcf7-captcha-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   File Upload
   ========================================================================== */

.wpcf7 input[type="file"] {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.wpcf7 input[type="file"]::-webkit-file-upload-button {
    padding: 0.5rem 1rem;
    font-family: var(--adst-font-family, "Montserrat", sans-serif);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    color: var(--adst-text, #111117);
    background-color: var(--adst-background, #F8F8F8);
    border: 1px solid rgb(var(--adst-light-rgb) / 0.6);
    border-radius: 0;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 220ms ease;
}

.wpcf7 input[type="file"]::-webkit-file-upload-button:hover {
    background-color: var(--adst-light, #DDDDDD);
}

/* ==========================================================================
   Hidden Fields Container
   ========================================================================== */

.wpcf7 .hidden-fields-container {
    display: none;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (min-width: 782px) {
    .wpcf7 .adst-form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .wpcf7 {
        max-width: 100%;
        padding: var(--space-4, 1rem);
    }

    .wpcf7 form {
        gap: var(--space-4, 1rem);
    }

    .wpcf7 input[type="text"],
    .wpcf7 input[type="email"],
    .wpcf7 input[type="tel"],
    .wpcf7 input[type="url"],
    .wpcf7 input[type="number"],
    .wpcf7 input[type="date"],
    .wpcf7 select,
    .wpcf7 textarea {
        padding: 0.75rem 1rem;
        font-size: var(--wp--preset--font-size--medium);
    }

    .wpcf7 input[type="submit"],
    .wpcf7 .wpcf7-submit {
        width: 100%;
        padding: 0.875rem 2rem;
    }

    .wpcf7-response-output {
        margin-top: var(--space-4, 1rem);
        padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
        font-size: var(--wp--preset--font-size--small);
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .wpcf7 * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .wpcf7 .wpcf7-spinner,
    .wpcf7-response-output {
        display: none !important;
    }
}
