/* Forms Base Styles using Figma Tokens */

:root {
    /* Form Colors */
    --input-text: #111B29;
    /* Primary-Grey-100 */
    /* --input-placeholder: #667489; Use Grey-100 for placeholder too per design? Or keep lighter? Design says #667489 which IS Grey-100 */
    --input-placeholder: #667489;

    --input-bg-default: #F7F8FA;
    /* Primary-Grey-20 */
    --input-bg-hover: #FAFBFD;
    /* Primary-Grey-10 */
    --input-bg-error: #F7F8FA;
    /* Primary-Grey-20 */
    --input-bg-disabled: #F1F4F8;
    /* Primary-Grey-40 */

    --input-border-default: transparent;
    /* No visible border by default */
    --input-border-hover: transparent;
    --input-border-focus: transparent;
    /* Or maybe subtle? Design implies focus state usually has ring or shadow, but asking to match 484:6197 which shows text color change */
    --input-border-error: #D83232;

    --input-label-active: #97A3B7;
    /* Primary-Grey-80 */

    --semantic-error: #D83232;
    --primary-red: #DF002F;

    /* Font Families - Assumes Lato is loaded */
    --font-form: 'Lato', sans-serif;
}

/* Form Container & Rows */
.form-row {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
}

/* Split Row - 2 Columns (Persists on Mobile) */
.dh-form-row--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}


/* Remove margin from last row (Submit button) */
.dh-hero__cf7-form .form-row {
    margin-bottom: 16px;
}

.dh-hero__cf7-form .form-row:last-of-type {
    margin-bottom: 0;
}

/* CF7 Wrapper positioning context fix */
.wpcf7-form-control-wrap {
    display: block !important;
    position: relative !important;
    width: 100%;
}

/* Base Input Styles (Shared) */
/* Base Input Styles (Shared) */
.form-input,
.form-select,
.form-textarea,
.wpcf7-form-control-wrap input[type="text"],
.wpcf7-form-control-wrap input[type="email"],
.wpcf7-form-control-wrap input[type="tel"],
.wpcf7-form-control-wrap textarea,
.wpcf7-form-control-wrap select {
    width: 100%;
    height: 50px;
    /* Reduced height to 50px */
    padding: 22px 16px 4px 16px;
    /* Adjusted padding: Top 22px prevents label overlap */
    background-color: var(--input-bg-default);
    border: 1px solid var(--input-border-default);
    border-radius: 8px;
    color: var(--input-placeholder);
    /* Default text color #667489 */
    font-family: var(--font-form);
    font-size: 16px;
    line-height: 1.32;
    font-weight: 400;
    transition: all 0.2s ease;
    box-sizing: border-box;
    outline: none;
    appearance: none;
}

/* Specific Height for Textarea */
.form-textarea,
.wpcf7-form-control-wrap textarea {
    height: 120px;
    padding-top: 24px;
    resize: vertical;
    color: var(--input-text);
    /* Textarea input can remain dark or match input? */
}

/* Input Value Color when typed (Active/Focus should be dark?) */
/* Actually design says Active value is #667489 (Grey 100). */
.form-input:focus,
.wpcf7-form-control-wrap input:focus,
.form-input:not(:placeholder-shown),
.wpcf7-form-control-wrap input:not(:placeholder-shown) {
    color: var(--input-placeholder);
    /* Keep it #667489 or #111B29? Design 484:6197 says #667489 for value */
}

/* Hover State */
.form-input:hover,
.form-select:hover,
.wpcf7-form-control-wrap input:not(:disabled):not([type="checkbox"]):not([type="radio"]):hover,
.wpcf7-form-control-wrap select:not(:disabled):hover,
.wpcf7-form-control-wrap textarea:not(:disabled):hover {
    background-color: var(--input-bg-hover);
    border-color: var(--input-border-hover);
}

/* Focus State */
.form-input:focus,
.form-select:focus,
.wpcf7-form-control-wrap input:focus,
.wpcf7-form-control-wrap select:focus,
.wpcf7-form-control-wrap textarea:focus {
    border-color: var(--input-border-focus);
    background-color: var(--input-bg-default);
    /* User requested to keep background */
}

/* Error State */
.form-input.wpcf7-not-valid,
.form-select.wpcf7-not-valid,
.wpcf7-not-valid .wpcf7-form-control {
    border-color: var(--input-border-error) !important;
    background-color: var(--input-bg-error) !important;
}

/* Disabled State */
.form-input:disabled,
.wpcf7-form-control-wrap input:disabled {
    background-color: var(--input-bg-disabled);
    color: #9CA3AF;
    cursor: not-allowed;
}

/* Floating Label Styles */
.floating-label {
    position: absolute;
    left: 16px;
    top: 17px;
    /* 50px height - 16px font / 2 ~ 17px. Hardcoded for stability. */
    /* transform: translateY(-50%); Removed to avoid subpixel issues */
    color: var(--input-placeholder);
    font-family: var(--font-form);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease-out;
    background-color: transparent;
    padding: 0;
    z-index: 10;
    transform-origin: left top;
    line-height: 1.32;
}

/* Textarea Floating Label position */
.form-row textarea~.floating-label,
.wpcf7-form-control-wrap textarea~.floating-label {
    top: 24px;
    transform: none;
}

/* Active/Filled State for Label */
/* Active/Filled State for Label */
.form-input:focus~.floating-label,
.form-select:focus~.floating-label,
.form-textarea:focus~.floating-label,
.wpcf7-form-control-wrap input:focus~.floating-label,
.wpcf7-form-control-wrap select:focus~.floating-label,
.wpcf7-form-control-wrap textarea:focus~.floating-label,
.has-value .floating-label,
.floating-label.is-active {
    top: 6px !important;
    /* Adjusted for 50px height. Added !important to force state change if specificity was issue */
    font-size: 12px;
    color: var(--input-label-active);
    /* #97A3B7 */
    transform: none;
    letter-spacing: 0.24px;
}

/* Adjust Select arrow */
.form-select,
.wpcf7-form-control-wrap select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23667489' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Hide Select text when showing placeholder (label is centered) */
select.showing-placeholder {
    color: transparent !important;
}

/* Checkboxes */
.form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 20px;
}

.form-checkboxes p {
    margin: 0;
}

.wpcf7-list-item {
    margin: 0 !important;
    display: block !important;
}

.wpcf7-list-item label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.wpcf7-list-item-label {
    display: inline-block;
    padding-left: 0;
    /* Handled by gap */
    font-size: 13px;
    color: #4A4A4A;
    line-height: 1.5;
    /* margin-top: -2px; Removed for alignment with new checkbox style, relying on checkbox margin-top */
}

.wpcf7-list-item-label a {
    color: var(--input-text);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.wpcf7-list-item-label a:hover {
    color: #E53359 !important;
    /* User requested specific red hover */
}

/* Custom Checkbox Appearance */
/* Custom Checkbox Appearance - Matching Newsletter */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1px solid var(--input-border-default);
    /* #97A3B7 if mapped, or explicit #97A3B7 from newsletter */
    border: 1px solid #97A3B7;
    /* Explicit match to newsletter */
    border-radius: 2px;
    background-color: #FFF;
    cursor: pointer;
    margin: 0;
    margin-top: 2px;
    /* Alignment fix */
    position: relative;
    display: grid;
    place-content: center;
    place-content: center;
    transition: all 0.2s ease;
}

/* Fix: Ensure border persists on focus/active */
input[type="checkbox"]:focus,
input[type="checkbox"]:active {
    outline: none;
    border: 1px solid #97A3B7;
    /* Maintain border */
    box-shadow: 0 0 0 2px rgba(17, 27, 41, 0.1);
    /* Optional: subtle focus ring */
}

input[type="checkbox"]:checked {
    background-color: #F7F8FA;
    /* Newsletter checked bg */
    border-color: #97A3B7;
    border-radius: 2px;
}

input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 8px;
    transform: scale(0);
    transition: 0.1s transform ease-in-out;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none'%3E%3Cpath d='M0.850098 4.2521L3.1181 6.5201L8.7881 0.850098' stroke='%23111B29' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Submit Button - Specificity Boost */
.form-submit input[type="submit"],
.dh-hero__cf7-form input[type="submit"] {
    display: flex;
    min-width: 180px;
    padding: 16px 24px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    align-self: stretch;
    width: 100%;
    border-radius: 200px !important;
    /* Force override */
    background: var(--primary-red, #DF002F) !important;
    color: #FFF;
    border: none;

    /* Button/Base - Bold */
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
    cursor: pointer;
    transition: background 0.3s ease;
}

.form-submit input[type="submit"]:hover,
.dh-hero__cf7-form input[type="submit"]:hover {
    border-radius: 200px !important;
    background: #E53359 !important;
    /* primary-red-80 */
}

/* Validation Errors */
/* Validation Errors */
.wpcf7-not-valid-tip {
    font-size: 12px;
    color: var(--semantic-error);
    margin-top: 4px;
    display: block;
    font-family: var(--font-form);
    letter-spacing: 0.24px;
}

/* Hide CF7 Loader */
.wpcf7-spinner {
    position: absolute;
    bottom: 15px;
    right: 20px;
}

/* Hide CF7 Response Output (Yellow Box / Validation Summary) */
.wpcf7-response-output {
    display: none !important;
}

/* Custom Success Message Styling */
.dh-hero__success-message {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 10px 10px 10px;
    /* Calculated padding: Wrapper has 30px top, 20px sides/bottom. Adding 0/10/10/10 makes visual 30/30/30/30 */
    animation: fadeIn 0.5s ease-out forwards;
    background: transparent;
    /* Rely on wrapper background */
    box-shadow: none;
    /* Rely on wrapper shadow */
    border-radius: 0;
}

.dh-success-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #FCE7E8;
    /* Light Red bg */
    margin-bottom: 0;
    flex-shrink: 0;
}

.dh-success-icon {
    width: 31px;
    height: 31px;
}

.dh-success-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dh-success-title {
    color: var(--Primary-Black-100, #111B29);
    font-family: var(--font-lato, 'Lato');
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.dh-success-text {
    color: var(--Primary-Black-100, #111B29);
    font-family: var(--font-lato, 'Lato');
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pricing Hero Form Styles (Moved from hero.css) */
.dh-hero__calendly-wrapper.dh-hero__form-wrapper {
    padding: 30px 20px 20px 20px;
    /* Reduced bottom padding */
    border-radius: 16px;
    background: var(--Primary-White, #FFF);
    box-shadow: 0 6px 16px 0 rgba(27, 27, 27, 0.08);
}

@media (min-width: 1024px) {
    .dh-hero__calendly-wrapper.dh-hero__form-wrapper {
        flex-shrink: 0;
        align-self: auto;
    }
}

.dh-hero__cf7-form {
    width: 100%;
}

.dh-hero__cf7-form .form-row {
    width: 100%;
}

/* Default spacing for standard CF7 forms (e.g., Únete al equipo) */
.dh-hero__cf7-form p {
    margin: 0 0 16px 0;
    padding: 0;
}

/* Specific reset for Contact page form to prevent double spacing */
/* Uses dynamically added class based on hero="contacto" attribute */
.dh-hero--contacto .dh-hero__cf7-form p {
    margin: 0;
    padding: 0;
}

.dh-hero__cf7-form input[type="submit"] {
    /* Override global submit button for Hero Pricing variant */
    border-radius: 200px !important;
    background: var(--primary-red-100, #DF002F) !important;
    padding: 14px 24px;
}

.dh-hero__cf7-form input[type="submit"]:hover {
    background: var(--primary-red-80, #E53359) !important;
}

/* Custom File Upload Styling (Moved from hero.css) */
.dh-form-file-upload {
    margin-bottom: 14px;
}

.dh-form-file-upload .dh-file-upload-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 14px 16px;
    background: var(--primary-grey-10, #F3F4F6);
    /* Asumiendo color de fondo suave */
    border: 1px dashed var(--primary-grey-40, #9CA3AF);
    /* Borde punteado */
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dh-file-upload-wrapper:hover {
    border: 1px solid var(--primary-grey-60, #E3E7EF);
    background: var(--primary-grey-10, #FAFBFD);
}

.dh-file-upload-icon {
    width: 33px;
    height: 33px;
    margin-bottom: 16px;
    display: block;
}

/* Validation Error State */
.dh-file-upload-wrapper.has-error {
    border: 1px solid var(--Semantic-Error-100, #D83232);
}

.dh-file-upload-label {
    color: var(--primary-grey-100, #667489);
    font-family: var(--font-lato, 'Lato');
    font-size: 16px;
    font-weight: 400;
    line-height: 132%;
    margin-bottom: 14px;
    display: block;
}

.dh-file-upload-label u {
    font-weight: 400;
    text-decoration: underline;
}

.dh-file-upload-info {
    color: var(--primary-grey-100, #667489);
    font-family: var(--font-lato, 'Lato');
    font-size: 10px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.2px;
    margin-bottom: 0;
    display: block;
    text-align: center;
}

/* Hide standard file input but keep it functional covering the area */
/* Hide standard file input but keep it functional covering the area */
.dh-form-file-upload .wpcf7-form-control-wrap {
    display: block !important;
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.dh-form-file-upload .wpcf7-file {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
    /* Ensure input itself is hidden but clickable */
}

/* Ensure paragraph inside wrapper doesn't break layout */
.dh-file-upload-wrapper p {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
}

/* Fix CF7 Auto-P/BR issues */
.dh-file-upload-wrapper br {
    display: none;
}

/* Selected File State */
/* Selected File State */
.dh-file-upload-wrapper.has-file .dh-file-upload-label,
.dh-file-upload-wrapper.has-file .dh-file-upload-info {
    /* Keep visible as per new design */
    display: block;
}

.dh-file-upload-wrapper.has-file .wpcf7-form-control-wrap {
    pointer-events: none;
    /* Disable input interaction when file selected */
}

.dh-file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Space out name and x */
    gap: 10px;
    width: 100%;
    z-index: 20;
    position: relative;
    /* Card Style */
    margin-top: 16px;
    padding: 10px 16px;
    background: #FFFFFF;
    border: 1px solid var(--primary-grey-20, #E5E7EB);
    border-radius: 6px;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05);
}

.dh-file-info-group {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    /* Ensure name ellipsis works */
}

.dh-file-type-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.dh-file-text-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
}

.dh-file-name {
    color: var(--primary-black-100, #111B29);
    font-family: var(--font-lato, 'Lato');
    font-size: 16px;
    font-weight: 400;
    line-height: 132%;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}

.dh-file-size {
    color: var(--primary-grey-100, #667489);
    font-family: var(--font-lato, 'Lato');
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.24px;
}

.dh-file-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.dh-file-remove:hover {
    background-color: rgba(223, 0, 47, 0.1);
}