/* =============================================
   Extrusion Contact Form — Popup Styles
   ============================================= */

/* Overlay backdrop */
.ecf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: ecfFadeIn 0.2s ease;
}

.ecf-overlay.ecf-open {
    display: flex;
}

@keyframes ecfFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal box */
.ecf-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: ecfSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ecfSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Scrollbar styling */
.ecf-modal::-webkit-scrollbar { width: 6px; }
.ecf-modal::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 8px; }
.ecf-modal::-webkit-scrollbar-thumb { background: #c0cfe0; border-radius: 8px; }

/* Close button */
.ecf-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.ecf-close:hover {
    background: rgba(255,255,255,0.35);
}

/* Header */
.ecf-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-radius: 16px 16px 0 0;
}

.ecf-header h2 {
    color: #ffffff;
    margin: 0 0 4px;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
}

.ecf-header p {
    color: rgba(255,255,255,0.8);
    margin: 0;
    font-size: 0.9rem;
}

.ecf-icon {
    flex-shrink: 0;
}

/* Form wrapper */
#ecf-form {
    padding: 28px 32px 32px;
}

/* Two-column row */
.ecf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Field */
.ecf-field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

.ecf-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.ecf-field label span {
    color: #e74c3c;
}

.ecf-field input,
.ecf-field select,
.ecf-field textarea {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #1f2937;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.ecf-field input:focus,
.ecf-field select:focus,
.ecf-field textarea:focus {
    border-color: #3498db;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

.ecf-field input.ecf-invalid,
.ecf-field select.ecf-invalid,
.ecf-field textarea.ecf-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.12);
}

.ecf-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox */
.ecf-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    color: #4b5563;
    cursor: pointer;
    font-size: 0.88rem;
}

.ecf-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: #3498db;
    cursor: pointer;
}

/* Error messages */
.ecf-error {
    color: #e74c3c;
    font-size: 0.78rem;
    margin-top: 4px;
    min-height: 18px;
    display: block;
}

/* Submit button */
.ecf-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.ecf-submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.ecf-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.ecf-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ecfSpin 0.7s linear infinite;
}

.ecf-spinner.ecf-spinning {
    display: block;
}

@keyframes ecfSpin {
    to { transform: rotate(360deg); }
}

/* Form-level error */
.ecf-form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    color: #b91c1c;
    font-size: 0.88rem;
    margin-top: 12px;
    display: none;
}

.ecf-form-error.ecf-visible {
    display: block;
}

/* Success state */
.ecf-success {
    display: none;
    text-align: center;
    padding: 50px 32px;
}

.ecf-success.ecf-visible {
    display: block;
}

.ecf-success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    font-size: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.ecf-success h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0 0 8px;
}

.ecf-success p {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0 0 24px;
}

.ecf-btn-close-success {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #fff;
    border: none;
    padding: 11px 32px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.ecf-btn-close-success:hover {
    opacity: 0.88;
}

/* Responsive */
@media (max-width: 600px) {
    .ecf-header { padding: 22px 20px; }
    #ecf-form { padding: 22px 20px 28px; }
    .ecf-row { grid-template-columns: 1fr; gap: 0; }
    .ecf-modal { border-radius: 12px; }
    .ecf-header h2 { font-size: 1.2rem; }
}
