/**
 * CF7 Entries — layout shortcode styles
 *
 * Version: 1.1
 *
 * Version History:
 * 1.0 - Initial container / row / field flex layout.
 * 1.1 - Fixed half/third fields collapsing to full width and overlapping:
 *       - Added `min-width: 0` to flex items (the core flexbox overflow fix).
 *       - Raised specificity on width modifiers so a theme's own field styles
 *         can no longer override the flex-basis.
 *       - Enforced `box-sizing: border-box` + `max-width: 100%` on all controls
 *         and wrappers so padded inputs never exceed the container.
 *       - Neutralised the CF7 `size="40"` intrinsic width.
 */

.wpcf7-container {
    --cf7-ink: #0f172a;
    --cf7-ink-soft: #64748b;
    --cf7-accent: #0783BE;
    --cf7-accent-strong: #066998;
    --cf7-accent-soft: rgba(7, 131, 190, 0.12);
    --cf7-border: #e2e8f0;
    --cf7-surface: #ffffff;
    --cf7-surface-muted: #f8fafc;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
    padding: 1.8em 1.6em;
    color: var(--cf7-ink);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--cf7-border);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    font-family: "Avenir Next", "Futura", "Gill Sans", "Trebuchet MS", sans-serif;
}

/* Keep every descendant on the border-box model so padding/border on inputs
   is subtracted from, not added to, the field width. */
.wpcf7-container *,
.wpcf7-container *::before,
.wpcf7-container *::after {
    box-sizing: border-box;
}

.wpcf7-container-sm { max-width: 400px; margin: 0 auto; }
.wpcf7-container-md { max-width: 800px; margin: 0 auto; }
.wpcf7-container-lg { max-width: 1200px; margin: 0 auto; }

.wpcf7-container .wpcf7-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    align-content: flex-start;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 0;
}

.wpcf7-container .wpcf7-field {
    box-sizing: border-box;
    /* min-width:0 lets a flex item shrink below the intrinsic width of its
       content (a wide <input>), which is what allows half/third to hold. */
    min-width: 0;
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 15px;
}

/* Form control wrappers must fill the field, not size to content. */
.wpcf7-container .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* Width modifiers — scoped through .wpcf7-row so they outrank a single-class
   theme rule on .wpcf7-field / .form-control. */
.wpcf7-container .wpcf7-row > .wpcf7-field-full {
    flex: 0 0 100%;
    max-width: 100%;
}

.wpcf7-container .wpcf7-row > .wpcf7-field-half {
    flex: 0 0 calc(50% - 0.5em);
    max-width: calc(50% - 0.5em);
}

.wpcf7-container .wpcf7-row > .wpcf7-field-third {
    flex: 0 0 calc(33.333% - 0.67em);
    max-width: calc(33.333% - 0.67em);
}

@media (max-width: 900px) {
    .wpcf7-container-lg { max-width: 98vw; }
}
@media (max-width: 700px) {
    .wpcf7-container-md, .wpcf7-container-lg { max-width: 98vw; }
    .wpcf7-container .wpcf7-row { flex-direction: column; gap: 0.5em; }
    .wpcf7-container .wpcf7-row > .wpcf7-field-half,
    .wpcf7-container .wpcf7-row > .wpcf7-field-third,
    .wpcf7-container .wpcf7-row > .wpcf7-field-full {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
@media (max-width: 500px) {
    .wpcf7-container, .wpcf7-container-sm, .wpcf7-container-md, .wpcf7-container-lg {
        padding: 0.5em 0.2em;
    }
}

.wpcf7-container input[type="text"],
.wpcf7-container input[type="email"],
.wpcf7-container input[type="tel"],
.wpcf7-container input[type="url"],
.wpcf7-container input[type="number"],
.wpcf7-container input[type="date"],
.wpcf7-container textarea,
.wpcf7-container select {
    width: 100%;
    max-width: 100%;
    /* Cancel the intrinsic width CF7 sets via size="40". */
    min-width: 0;
    padding: 0.8em 0.95em;
    border: 1px solid var(--cf7-border);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    font-size: 1em;
    color: var(--cf7-ink);
}
.wpcf7-container input:focus,
.wpcf7-container textarea:focus,
.wpcf7-container select:focus {
    box-shadow: 0 0 0 3px var(--cf7-accent-soft);
    outline: none;
    color: var(--cf7-ink);
    border-color: var(--cf7-accent);
    background: #fff;
}
.wpcf7-container label {
    font-weight: 600;
    margin-bottom: 0.5em;
    display: block;
    color: var(--cf7-ink-soft);
    letter-spacing: 0.02em;
}

/* An empty <label> authored purely to satisfy `for=""` should not reserve
   vertical space above the input. */
.wpcf7-container .wpcf7-field > label:empty {
    display: none;
}

.wpcf7-not-valid-tip{
    font-size: 0.75em;
    color: #c90000;
}

.wpcf7-container input[type="submit"],
.wpcf7-container button,
.wpcf7-container input[type="button"] {
    background: var(--cf7-accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.85em 1.6em;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(7, 131, 190, 0.22);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.wpcf7-container input[type="submit"]:hover,
.wpcf7-container button:hover,
.wpcf7-container input[type="button"]:hover {
    background: var(--cf7-accent-strong);
    transform: translateY(-1px);
    box-shadow: 0 16px 26px rgba(7, 131, 190, 0.24);
}
