/* ===================================================
   AE360 – Formulario de Contacto 2026-05-06 v5
   Colores corporativos: #1C4B42 | #B4E717
   =================================================== */

/* ---- Wrapper: funciona tanto en página normal como en popup Elementor ---- */
.ae360-cf-wrapper {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    color: #1a1a1a;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.45;
}

/* Cuando está en página normal (no popup) le damos margen vertical */
.ae360-cf-wrapper.ae360-page {
    margin: 40px auto;
}

.ae360-cf-inner {
    background: #ffffff;
    border: 1px solid #dde8e6;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(28,75,66,.12);
    overflow: hidden;
}

/* En el popup de la landing el formulario debe caber y poder desplazarse. */
.contact-popup .ae360-cf-wrapper {
    max-width: 560px;
}

.contact-popup .ae360-cf-inner {
    max-height: calc(90vh - 36px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.contact-popup__panel:has(.ae360-cf-wrapper) {
    width: min(640px, calc(100vw - 28px)) !important;
}

.contact-popup__panel-inner:has(.ae360-cf-wrapper) {
    max-height: min(94vh, 920px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.contact-popup__content:has(.ae360-cf-wrapper) {
    overflow: visible !important;
}

.contact-popup__panel:has(.ae360-cf-wrapper) .contact-popup__close {
    top: 18px !important;
    right: 18px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(28, 75, 66, .92) !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 12px 28px rgba(18, 49, 43, .28) !important;
    opacity: 1 !important;
}

.contact-popup__panel:has(.ae360-cf-wrapper) .contact-popup__close::before,
.contact-popup__panel:has(.ae360-cf-wrapper) .contact-popup__close::after {
    width: 20px !important;
    height: 3px !important;
    background: #ffffff !important;
}

.contact-popup__panel:has(.ae360-cf-wrapper) .contact-popup__close:hover {
    background: #B4E717 !important;
    transform: scale(1.06) !important;
}

.contact-popup__panel:has(.ae360-cf-wrapper) .contact-popup__close:hover::before,
.contact-popup__panel:has(.ae360-cf-wrapper) .contact-popup__close:hover::after {
    background: #1C4B42 !important;
}

/* ---- Header ---- */
.ae360-cf-header {
    background: #1C4B42;
    border-radius: 15px 15px 0 0;
    padding: 18px 30px 16px;
    text-align: center;
}

.ae360-cf-bolt {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
    line-height: 1;
}

.ae360-cf-header h3 {
    margin: 0 0 7px !important;
    font-size: clamp(1.35rem, 2vw, 1.6rem) !important;
    font-weight: 700;
    color: #B4E717 !important;
    letter-spacing: -.2px;
    line-height: 1.15 !important;
}

.contact-popup .lead-form .ae360-cf-wrapper .ae360-cf-header h3 {
    font-size: clamp(1.35rem, 2vw, 1.6rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -.2px !important;
}

.ae360-cf-header p {
    margin: 0 !important;
    font-size: .9rem !important;
    color: rgba(255,255,255,.75) !important;
    line-height: 1.45 !important;
}

.contact-popup .lead-form .ae360-cf-wrapper .ae360-cf-header p,
.contact-popup .lead-form .ae360-cf-wrapper .ae360-field-hint {
    font-size: .9rem !important;
    line-height: 1.45 !important;
}

/* ---- Form body ---- */
.ae360-form {
    padding: 20px 30px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    border-radius: 0 0 13px 13px;
    box-sizing: border-box;
}

/* ---- Field ---- */
.ae360-cf-wrapper .ae360-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.ae360-cf-wrapper .ae360-field > label,
.ae360-cf-wrapper .ae360-field label:not(.ae360-checkbox-label) {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: #1C4B42;
    margin: 0;
    padding: 0;
    display: block;
}

.ae360-cf-wrapper .ae360-field .req {
    color: #B4E717;
    -webkit-text-stroke: .4px #7aad00;
    margin-left: 2px;
}

/* ---- Inputs ---- */
.ae360-cf-wrapper .ae360-field input[type="text"],
.ae360-cf-wrapper .ae360-field input[type="tel"],
.ae360-cf-wrapper .ae360-field input[type="email"] {
    background: #ffffff !important;
    border: 1.5px solid #c8d8d5 !important;
    border-radius: 8px !important;
    color: #1a1a1a !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    padding: 10px 14px !important;
    transition: border-color .2s, box-shadow .2s;
    outline: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    appearance: none;
    margin: 0 !important;
    box-shadow: none !important;
    height: auto !important;
}

.ae360-cf-wrapper .ae360-field input[type="text"]:focus,
.ae360-cf-wrapper .ae360-field input[type="tel"]:focus,
.ae360-cf-wrapper .ae360-field input[type="email"]:focus {
    border-color: #1C4B42 !important;
    box-shadow: 0 0 0 3px rgba(28,75,66,.15) !important;
    background: #ffffff !important;
}

.ae360-cf-wrapper .ae360-field input[type="text"]::placeholder,
.ae360-cf-wrapper .ae360-field input[type="tel"]::placeholder {
    color: #aab8b5;
    opacity: 1;
}

/* ---- Input error ---- */
.ae360-cf-wrapper .ae360-field input.has-error {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192,57,43,.12) !important;
}

/* ---- Manual consumption selector ---- */
.ae360-cf-wrapper .ae360-field-hint {
    margin: 0 0 4px;
    color: #667d78;
    font-size: .86rem;
    line-height: 1.45;
}

.ae360-cf-wrapper .ae360-consumption-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.ae360-cf-wrapper .ae360-consumption-option {
    display: grid !important;
    min-height: 68px;
    align-content: center;
    gap: 2px;
    border: 1.5px solid #c8d8d5 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #1C4B42 !important;
    cursor: pointer;
    font-family: inherit !important;
    font-size: .92rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    padding: 9px 12px !important;
    text-align: center;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
    width: 100%;
}

.ae360-cf-wrapper .ae360-consumption-option span {
    display: block;
}

.ae360-cf-wrapper .ae360-consumption-name {
    font-size: .88rem;
    font-weight: 800;
}

.ae360-cf-wrapper .ae360-consumption-price {
    color: #1C4B42;
    font-size: .8rem;
    font-weight: 800;
}

.ae360-cf-wrapper .ae360-consumption-kwh {
    color: #667d78;
    font-size: .72rem;
    font-weight: 600;
}

.ae360-cf-wrapper .ae360-consumption-option:hover {
    background: #f6faf9 !important;
    border-color: #1C4B42 !important;
}

.ae360-cf-wrapper .ae360-consumption-option:focus-visible {
    outline: 3px solid rgba(180,231,23,.55);
    outline-offset: 3px;
}

.ae360-cf-wrapper .ae360-consumption-option:active {
    transform: scale(.98);
}

.ae360-cf-wrapper .ae360-consumption-option.is-active {
    background: rgba(180,231,23,.2) !important;
    border-color: #1C4B42 !important;
    box-shadow: 0 0 0 3px rgba(28,75,66,.12) !important;
}

/* ---- Upload area ---- */
.ae360-cf-wrapper .ae360-upload-area {
    position: relative;
    border: 2px dashed #c8d8d5;
    border-radius: 8px;
    background: #f6faf9;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    overflow: hidden;
    min-height: 76px;
}

.ae360-cf-wrapper .ae360-upload-area:hover,
.ae360-cf-wrapper .ae360-upload-area.drag-over {
    border-color: #1C4B42;
    background: rgba(28,75,66,.05);
}

.ae360-cf-wrapper .ae360-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    padding: 0;
}

.ae360-cf-wrapper .ae360-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    gap: 5px;
    pointer-events: none;
    text-align: center;
}

.ae360-cf-wrapper .ae360-upload-label svg {
    width: 24px;
    height: 24px;
    color: #1C4B42;
    flex-shrink: 0;
}

.ae360-cf-wrapper .ae360-upload-label span {
    font-size: .9rem;
    color: #3a6b62;
    font-weight: 500;
}

.ae360-cf-wrapper .ae360-upload-label small {
    font-size: .78rem;
    color: #8aada8;
}

.ae360-cf-wrapper .ae360-upload-area.file-selected {
    border-color: #1C4B42;
    background: rgba(28,75,66,.06);
}

.ae360-cf-wrapper .ae360-upload-area.file-selected .ae360-upload-label span {
    color: #1C4B42;
    font-weight: 600;
}

.ae360-cf-wrapper .ae360-upload-area.has-error {
    border-color: #c0392b !important;
}

/* ---- Checkbox RGPD ---- */
.ae360-cf-wrapper .ae360-check {
    gap: 4px !important;
    margin: 0 !important;
}

.ae360-cf-wrapper .ae360-checkbox-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    cursor: pointer;
    font-size: .88rem;
    color: #4a4a4a;
    line-height: 1.5;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 400 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ae360-cf-wrapper .ae360-checkbox-label input[type="checkbox"] {
    display: inline-block !important;
    float: none !important;
    position: relative !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: #1C4B42;
    flex-shrink: 0 !important;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: none !important;
    border-radius: 3px;
}

.ae360-cf-wrapper .ae360-checkbox-label span {
    display: inline !important;
    flex: 1;
}

.ae360-cf-wrapper .ae360-checkbox-label a {
    color: #1C4B42;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ae360-cf-wrapper .ae360-checkbox-label a:hover {
    color: #B4E717;
}

/* ---- Errors ---- */
.ae360-cf-wrapper .ae360-error {
    font-size: .78rem;
    color: #c0392b;
    min-height: 0;
    display: block;
    font-weight: 500;
    margin: 0;
}

/* ---- Submit button ---- */
.ae360-cf-wrapper .ae360-submit {
    display: block !important;
    background: #1C4B42 !important;
    color: #ffffff !important;
    border: 2px solid #1C4B42 !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: .2px;
    padding: 13px 22px !important;
    cursor: pointer;
    transition: background .22s ease, color .22s ease, border-color .22s ease, transform .12s ease, box-shadow .22s ease;
    width: 100% !important;
    margin-top: 6px !important;
    margin-bottom: 0 !important;
    text-align: center;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
    /* Asegurar que no quede cortado en popups */
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

.ae360-cf-wrapper .ae360-submit:hover {
    background: #B4E717 !important;
    color: #1C4B42 !important;
    border-color: #B4E717 !important;
    box-shadow: 0 4px 18px rgba(180,231,23,.35) !important;
    transform: translateY(-1px);
}

.ae360-cf-wrapper .ae360-submit:active {
    transform: translateY(0);
    background: #a0d010 !important;
    border-color: #a0d010 !important;
}

.ae360-cf-wrapper .ae360-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* ---- Success ---- */
.ae360-cf-wrapper .ae360-success {
    padding: 48px 36px;
    text-align: center;
    background: #ffffff;
    border-radius: 0 0 13px 13px;
}

.ae360-cf-wrapper .ae360-success-icon {
    width: 58px;
    height: 58px;
    background: #1C4B42;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #B4E717;
    margin: 0 auto 18px;
    animation: ae360-pop .4s cubic-bezier(.175,.885,.32,1.275) both;
}

.ae360-cf-wrapper .ae360-success p {
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

@keyframes ae360-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
    .ae360-cf-wrapper .ae360-consumption-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .ae360-cf-header { padding: 20px 22px 18px; border-radius: 13px 13px 0 0; }
    .ae360-cf-header h3 { font-size: 1.2rem; }
    .ae360-form { padding: 20px 20px 24px; gap: 14px; }
    .ae360-cf-wrapper .ae360-success { padding: 36px 20px; }
    .ae360-cf-wrapper .ae360-consumption-option { min-height: 68px; }
}
