/* ESSA Leads Frontend v1.0.0 · Scope: .elf-* */

/* ── INLINE ── */
.elf-inline { max-width: 560px; }
.elf-inline-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* ── TRIGGER BUTTON ── */
.elf-trigger-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: transform .15s, opacity .15s;
}
.elf-trigger-btn:hover { transform: translateY(-2px); opacity: .9; }

/* ── OVERLAY ── */
.elf-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.65);
    z-index: 99999; display: flex; align-items: center; justify-content: center;
    padding: 16px; backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s;
}
.elf-overlay.is-open { opacity: 1; visibility: visible; }

/* ── POPUP ── */
.elf-popup {
    background: #fff; border-radius: 16px; padding: 36px 36px 32px;
    width: 100%; max-width: 500px; max-height: 92vh; overflow-y: auto;
    position: relative; box-shadow: 0 24px 80px rgba(0,0,0,.3);
    transform: scale(.94) translateY(10px); transition: transform .22s;
}
.elf-overlay.is-open .elf-popup { transform: scale(1) translateY(0); }

/* ── CLOSE ── */
.elf-close {
    position: absolute; top: 14px; right: 14px;
    background: #f1f1f1; border: none; border-radius: 50%;
    width: 32px; height: 32px; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #666; transition: background .15s;
}
.elf-close:hover { background: #e0e0e0; }

/* ── POPUP HEADER ── */
.elf-popup-header { text-align: center; margin-bottom: 22px; }
.elf-popup-icon   { font-size: 36px; margin-bottom: 8px; }
.elf-popup-title  { font-size: 20px; font-weight: 700; color: #111; margin: 0; }

/* ── FORM ── */
.elf-form { display: flex; flex-direction: column; gap: 12px; }
.elf-row  { display: flex; gap: 12px; }
.elf-row .elf-field { flex: 1; }

.elf-field { display: flex; flex-direction: column; gap: 5px; }
.elf-field label {
    font-size: 12px; font-weight: 600; color: #555;
    text-transform: uppercase; letter-spacing: .05em;
}
.elf-req { color: #e53e3e; }

.elf-field input,
.elf-field textarea,
.elf-field select {
    padding: 11px 14px; border: 1.5px solid #e0e0e0;
    border-radius: 8px; font-size: 14px; font-family: inherit;
    color: #222; background: #fafafa; outline: none;
    transition: border-color .15s, box-shadow .15s; width: 100%;
    -webkit-appearance: none;
}
.elf-field input:focus,
.elf-field textarea:focus,
.elf-field select:focus {
    border-color: #2CFFC0;
    box-shadow: 0 0 0 3px rgba(44,255,192,.15);
    background: #fff;
}
.elf-field input.is-error,
.elf-field textarea.is-error,
.elf-field select.is-error { border-color: #e53e3e; }
.elf-field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.elf-error { font-size: 12px; color: #e53e3e; min-height: 16px; }
.elf-radios { display: flex; flex-direction: column; gap: 6px; }
.elf-radio-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.elf-field-check .elf-check-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; cursor: pointer; }

/* ── SUBMIT ── */
.elf-submit {
    padding: 13px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    font-family: inherit; background: #2CFFC0; color: #0f0e1a;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; transition: opacity .15s, transform .15s;
    position: relative; min-height: 48px;
}
.elf-submit:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.elf-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.elf-submit.is-loading .elf-submit-text { opacity: 0; }
.elf-submit.is-loading .elf-spinner    { display: block; position: absolute; }
.elf-spinner {
    display: none; width: 18px; height: 18px;
    border: 2px solid rgba(0,0,0,.15); border-top-color: #0f0e1a;
    border-radius: 50%; animation: elf-spin .6s linear infinite;
}
@keyframes elf-spin { to { transform: rotate(360deg); } }

/* ── MSG / SUCCESS ── */
.elf-msg { font-size: 13px; text-align: center; border-radius: 6px; padding: 0; min-height: 0; }
.elf-msg.is-error { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; padding: 9px 14px; margin-top: 4px; }
.elf-success { text-align: center; padding: 8px 0; }
.elf-success-icon { font-size: 48px; margin-bottom: 10px; }
.elf-success-text { font-size: 16px; color: #333; line-height: 1.6; margin: 0 0 16px; }
.elf-success-close { position: static; display: inline-block; width: auto; padding: 9px 24px; border-radius: 8px; background: #f1f1f1; font-size: 14px; font-weight: 600; }

/* ── DARK MODE ── */
@media (prefers-color-scheme: dark) {
    .elf-popup { background: #1a1828; }
    .elf-popup-title { color: #fff; }
    .elf-field label { color: #9ca3af; }
    .elf-field input, .elf-field textarea, .elf-field select { background: #0f0e1a; border-color: #2a2840; color: #e2e0f0; }
    .elf-field input:focus, .elf-field textarea:focus, .elf-field select:focus { background: #0f0e1a; }
    .elf-close { background: #2a2840; color: #9ca3af; }
    .elf-close:hover { background: #3a3860; color: #fff; }
    .elf-success-text { color: #e2e0f0; }
    .elf-success-close { background: #2a2840; color: #e2e0f0; }
}

@media (max-width: 540px) {
    .elf-popup { padding: 28px 20px 24px; }
    .elf-row   { flex-direction: column; gap: 0; }
}
