/**
 * H2J Forms — Front-Office Styles
 *
 * Uses CSS custom properties from H2JFormsAppearance (--h2jforms-*)
 * with fallback to Design System (--h2j-*) and sensible defaults.
 *
 * @author    H2J Ecosystem <info@2klove.fr>
 * @copyright 2024-2026 H2J sas RCS 978391720
 * @license   Commercial license
 */

/* ── Base form container ── */
.h2jforms-form,
#customer-form,
#login-form,
#contact-form {
    max-width: var(--h2jforms-maxw, var(--h2j-maxw, 600px));
}

/* ── Input styling ── */
.h2jforms-form input[type="text"],
.h2jforms-form input[type="email"],
.h2jforms-form input[type="tel"],
.h2jforms-form input[type="password"],
.h2jforms-form input[type="number"],
.h2jforms-form input[type="date"],
.h2jforms-form textarea,
.h2jforms-form select {
    background: var(--h2jforms-input-bg, var(--h2j-input-bg, #f8fafc));
    border: 1px solid var(--h2jforms-border, var(--h2j-border, #e2e8f0));
    border-radius: var(--h2jforms-radius, var(--h2j-radius, 8px));
    font-size: var(--h2jforms-font, var(--h2j-font, 14px));
    color: var(--h2jforms-text, var(--h2j-text, #1e293b));
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.h2jforms-form input:focus,
.h2jforms-form textarea:focus,
.h2jforms-form select:focus {
    border-color: var(--h2jforms-primary, var(--h2j-primary, #6366f1));
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* ── Submit button ── */
.h2jforms-form .btn-primary,
.h2jforms-form [type="submit"] {
    background: var(--h2jforms-primary, var(--h2j-primary, #6366f1));
    color: #fff;
    border: none;
    border-radius: var(--h2jforms-radius, var(--h2j-radius, 8px));
    padding: 12px 28px;
    font-size: var(--h2jforms-font, var(--h2j-font, 14px));
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.h2jforms-form .btn-primary:hover,
.h2jforms-form [type="submit"]:hover {
    opacity: 0.9;
}

/* ── Links ── */
.h2jforms-form a {
    color: var(--h2jforms-link, var(--h2j-link, #6366f1));
}

/* ── VIP code field styling ── */
.form-group[data-name="h2jforms_vip_code"] {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px dashed var(--h2jforms-primary, var(--h2j-primary, #6366f1));
    border-radius: var(--h2jforms-radius, var(--h2j-radius, 8px));
    padding: 16px;
    margin: 16px 0;
}

/* ── Honeypot (invisible) ── */
.h2jforms-hp {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* ── Password strength bar ── */
.h2jforms-pwd-strength {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-top: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.h2jforms-pwd-strength__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background-color 0.3s;
}

.h2jforms-pwd-strength--1 .h2jforms-pwd-strength__fill { width: 20%; background: #ef4444; }
.h2jforms-pwd-strength--2 .h2jforms-pwd-strength__fill { width: 40%; background: #f97316; }
.h2jforms-pwd-strength--3 .h2jforms-pwd-strength__fill { width: 60%; background: #eab308; }
.h2jforms-pwd-strength--4 .h2jforms-pwd-strength__fill { width: 80%; background: #22c55e; }
.h2jforms-pwd-strength--5 .h2jforms-pwd-strength__fill { width: 100%; background: #16a34a; }

.h2jforms-pwd-strength__label {
    font-size: 11px;
    margin-top: 4px;
    color: var(--h2jforms-text, var(--h2j-text-light, #64748b));
}

/* ── Password generate button ── */
.h2jforms-pwd-generate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--h2jforms-primary, var(--h2j-primary, #6366f1));
    color: var(--h2jforms-primary, var(--h2j-primary, #6366f1));
    border-radius: var(--h2jforms-radius, var(--h2j-radius, 8px));
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s, color 0.2s;
}

.h2jforms-pwd-generate:hover {
    background: var(--h2jforms-primary, var(--h2j-primary, #6366f1));
    color: #fff;
}

.h2jforms-pwd-generate .material-icons {
    font-size: 16px;
}

/* ── Password requirements checklist ── */
.h2jforms-pwd-requirements {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    font-size: 12px;
}

.h2jforms-pwd-requirements li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: var(--h2jforms-text, var(--h2j-text-light, #64748b));
}

.h2jforms-pwd-requirements li .material-icons {
    font-size: 14px;
}

.h2jforms-pwd-requirements li.h2jforms-req--ok {
    color: #22c55e;
}

.h2jforms-pwd-requirements li.h2jforms-req--fail {
    color: #94a3b8;
}

/* ── Hidden fields (controlled by config) ── */
.h2jforms-hidden {
    display: none !important;
}
