/* ==============================
   ESTANDAR FORMS – FRONTEND
============================== */

/* CONTENEDOR GENERAL */
.estandar-form {
    max-width: 920px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.estandar-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.estandar-form-success,
.estandar-form-error {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    line-height: 1.4;
}

.estandar-form-success {
    background: #e8f8ec;
    border: 1px solid #7dc98f;
    color: #1f5f2f;
}

.estandar-form-error {
    background: #fff2f1;
    border: 1px solid #e87b74;
    color: #8b2d27;
}

.estandar-form-error ul {
    margin: 8px 0 0 18px;
}

.estandar-error-link {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-align: left;
    text-decoration: underline;
}

.estandar-form-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* CAMPOS */
.estandar-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.estandar-form-field.is-hidden,
.estandar-form-field[hidden] {
    display: none !important;
}

.estandar-col-span-1 {
    grid-column: span 1;
}

.estandar-col-span-2 {
    grid-column: span 2;
}

.estandar-col-span-3,
.estandar-type-heading,
.estandar-type-html {
    grid-column: span 3;
}

.estandar-form-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.estandar-form-field input[type="text"],
.estandar-form-field input[type="email"],
.estandar-form-field input[type="tel"],
.estandar-form-field input[type="number"],
.estandar-form-field input[type="date"],
.estandar-form-field input[type="file"],
.estandar-form-field select,
.estandar-form-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.estandar-form-field textarea {
    min-height: 100px;
}

.estandar-form-field.has-error input,
.estandar-form-field.has-error select,
.estandar-form-field.has-error textarea {
    border-color: #d93025;
    box-shadow: 0 0 0 2px rgba(217, 48, 37, 0.16);
}

.estandar-field-error {
    border-left: 3px solid #d93025;
    margin: 0;
    padding-left: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #b42318;
}

/* CHECKBOX / RADIO */
.estandar-form-field input[type="checkbox"],
.estandar-form-field input[type="radio"] {
    margin-right: 6px;
}

.estandar-type-radio label,
.estandar-type-checkbox label {
    font-weight: normal;
}

/* HTML / HEADINGS */
.estandar-form-html {
    margin: 16px 0;
}

.estandar-form-heading {
    margin: 20px 0 8px;
}

/* BOTÓN Y TEXTO POSTERIOR */
.estandar-form-actions {
    margin-top: 24px;
    grid-column: 1 / -1;
}

.estandar-form-submit {
    background: #111;
    color: #fff;
    padding: 12px 20px;
    font-size: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.estandar-form-submit:hover {
    opacity: 0.9;
}

/* Preset visual: AK Contadores */
.estandar-form-theme-ak_contadores {
    --primary-color: #a9cf3f;
    --border-color: #a9cf3f;
    --button-color: #a9cf3f;
    --button-text-color: #fff;
    max-width: 100%;
    gap: 14px;
}

.estandar-form-theme-ak_contadores .estandar-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 28px;
}

.estandar-form-theme-ak_contadores .estandar-col-span-1,
.estandar-form-theme-ak_contadores .estandar-col-span-3,
.estandar-form-theme-ak_contadores .estandar-type-heading,
.estandar-form-theme-ak_contadores .estandar-type-html {
    grid-column: 1 / -1;
}

.estandar-form-theme-ak_contadores .estandar-col-span-2 {
    grid-column: span 1;
}

.estandar-form-theme-ak_contadores .estandar-form-field {
    gap: 6px;
}

.estandar-form-theme-ak_contadores .estandar-form-field label,
.estandar-form-theme-ak_contadores .estandar-radio-label {
    color: #565656;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.15;
}

.estandar-form-theme-ak_contadores .estandar-required {
    color: #e8452e;
}

.estandar-form-theme-ak_contadores .estandar-form-field input[type="text"],
.estandar-form-theme-ak_contadores .estandar-form-field input[type="email"],
.estandar-form-theme-ak_contadores .estandar-form-field input[type="tel"],
.estandar-form-theme-ak_contadores .estandar-form-field input[type="number"],
.estandar-form-theme-ak_contadores .estandar-form-field input[type="date"],
.estandar-form-theme-ak_contadores .estandar-form-field select,
.estandar-form-theme-ak_contadores .estandar-form-field textarea {
    min-height: 49px;
    padding: 10px 14px;
    background-color: #f7f8fb;
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: none;
    color: #222;
    font-size: 15px;
    line-height: 1.35;
}

.estandar-form-theme-ak_contadores .estandar-form-field select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #b9b9b9 50%),
        linear-gradient(135deg, #b9b9b9 50%, transparent 50%);
    background-position:
        calc(100% - 22px) 50%,
        calc(100% - 16px) 50%;
    background-repeat: no-repeat;
    background-size: 6px 6px, 6px 6px;
    padding-right: 44px;
}

.estandar-form-theme-ak_contadores .estandar-form-field textarea {
    min-height: 190px;
    resize: vertical;
}

.estandar-form-theme-ak_contadores .estandar-form-actions {
    margin-top: 14px;
}

.estandar-form-theme-ak_contadores .estandar-form-submit {
    width: 100%;
    min-height: 72px;
    padding: 16px 22px;
    background: var(--button-color);
    border-radius: 4px;
    box-shadow: 0 8px 14px rgba(90, 118, 24, 0.24);
    color: var(--button-text-color);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.08;
}

.estandar-form-theme-ak_contadores .estandar-form-submit:hover {
    opacity: 0.95;
}

.estandar-form-theme-ak_contadores .estandar-form-field.has-error input,
.estandar-form-theme-ak_contadores .estandar-form-field.has-error select,
.estandar-form-theme-ak_contadores .estandar-form-field.has-error textarea {
    border-color: #d93025;
}

.estandar-form-after-submit {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .estandar-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .estandar-col-span-3,
    .estandar-type-heading,
    .estandar-type-html {
        grid-column: span 2;
    }
}

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

    .estandar-col-span-1,
    .estandar-col-span-2,
    .estandar-col-span-3,
    .estandar-type-heading,
    .estandar-type-html {
        grid-column: span 1;
    }

    .estandar-form-field input[type="text"],
    .estandar-form-field input[type="email"],
    .estandar-form-field input[type="tel"],
    .estandar-form-field input[type="number"],
    .estandar-form-field input[type="date"],
    .estandar-form-field input[type="file"],
    .estandar-form-field select,
    .estandar-form-field textarea {
        min-height: 44px;
        font-size: 16px;
        line-height: 1.4;
    }

    .estandar-form-submit {
        min-height: 44px;
        padding: 12px 22px;
        font-size: 16px;
    }

    .estandar-form-theme-ak_contadores .estandar-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .estandar-form-theme-ak_contadores .estandar-col-span-1,
    .estandar-form-theme-ak_contadores .estandar-col-span-2,
    .estandar-form-theme-ak_contadores .estandar-col-span-3,
    .estandar-form-theme-ak_contadores .estandar-type-heading,
    .estandar-form-theme-ak_contadores .estandar-type-html {
        grid-column: 1 / -1;
    }

    .estandar-form-theme-ak_contadores .estandar-form-submit {
        min-height: 60px;
        font-size: 20px;
    }
}
