/* ============================================
   Jenius Lead Capture - Public Form Styles
   ============================================ */

.jlc-form-wrapper {
    --jlc-primary: #4F46E5;
    --jlc-primary-hover: color-mix(in srgb, var(--jlc-primary) 85%, black);
    --jlc-primary-light: color-mix(in srgb, var(--jlc-primary) 10%, white);
    --jlc-bg: #FFFFFF;
    --jlc-text: #1F2937;
    --jlc-muted: #6B7280;
    --jlc-border: #D1D5DB;
    --jlc-border-focus: var(--jlc-primary);
    --jlc-radius: 8px;
    --jlc-font-size: 15px;
    --jlc-error: #DC2626;
    --jlc-success: #059669;
    background: var(--jlc-bg);
    color: var(--jlc-text);
    font-size: var(--jlc-font-size);
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
    border-radius: calc(var(--jlc-radius) + 4px);
    box-sizing: border-box;
}

.jlc-form-wrapper *,
.jlc-form-wrapper *::before,
.jlc-form-wrapper *::after {
    box-sizing: border-box;
}

/* Title */
.jlc-form-title {
    margin: 0 0 24px 0;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--jlc-text);
}

/* Grid */
.jlc-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.jlc-field-full {
    grid-column: 1 / -1;
}

/* Labels */
.jlc-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--jlc-text);
}

.jlc-required {
    color: var(--jlc-error);
    font-weight: 400;
}

/* Inputs */
.jlc-input {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--jlc-font-size);
    font-family: inherit;
    color: var(--jlc-text);
    background: var(--jlc-bg);
    border: 1.5px solid var(--jlc-border);
    border-radius: var(--jlc-radius);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.jlc-input::placeholder {
    color: var(--jlc-muted);
    opacity: 0.7;
}

.jlc-input:focus {
    border-color: var(--jlc-border-focus);
    box-shadow: 0 0 0 3px var(--jlc-primary-light);
}

.jlc-input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: var(--jlc-error);
}

.jlc-textarea {
    resize: vertical;
    min-height: 120px;
}

.jlc-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
}

/* Field Error */
.jlc-field-error {
    margin-top: 4px;
    font-size: 0.8em;
    color: var(--jlc-error);
}

.jlc-field.jlc-has-error .jlc-input {
    border-color: var(--jlc-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* GDPR */
.jlc-gdpr-field {
    margin-top: 4px;
}

.jlc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85em;
    color: var(--jlc-muted);
    line-height: 1.4;
}

.jlc-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--jlc-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Submit */
.jlc-form-footer {
    margin-top: 24px;
}

.jlc-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 28px;
    font-size: var(--jlc-font-size);
    font-weight: 600;
    font-family: inherit;
    color: #FFFFFF;
    background: var(--jlc-primary);
    border: none;
    border-radius: var(--jlc-radius);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.jlc-submit-btn:hover {
    background: var(--jlc-primary-hover);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--jlc-primary) 30%, transparent);
}

.jlc-submit-btn:active {
    transform: translateY(1px);
}

.jlc-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.jlc-btn-spinner svg {
    animation: jlc-spin 0.8s linear infinite;
}

@keyframes jlc-spin {
    to { transform: rotate(360deg); }
}

/* Messages */
.jlc-form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--jlc-radius);
    font-size: 0.9em;
    line-height: 1.5;
}

.jlc-form-message.jlc-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.jlc-form-message.jlc-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

/* Theme: Modern (default) */
.jlc-theme-modern {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #E5E7EB;
}

/* Theme: Inherit Page Styles */
.jlc-theme-inherit {
    /* Use theme/page colors when available (block themes often provide these vars) */
    --jlc-primary: var(--wp--preset--color--primary, currentColor);
    --jlc-bg: transparent;
    --jlc-text: inherit;
    --jlc-muted: color-mix(in srgb, currentColor 65%, transparent);
    --jlc-border: color-mix(in srgb, currentColor 20%, transparent);
    --jlc-border-focus: var(--jlc-primary);
    --jlc-primary-light: color-mix(in srgb, var(--jlc-primary) 18%, transparent);

    background: transparent;
    color: inherit;
    font: inherit;
    box-shadow: none;
    border: none;
}

.jlc-theme-inherit .jlc-form-title {
    color: inherit;
}

.jlc-theme-inherit .jlc-input {
    background: color-mix(in srgb, currentColor 4%, transparent);
    color: inherit;
}

.jlc-theme-inherit .jlc-input::placeholder {
    color: color-mix(in srgb, currentColor 55%, transparent);
}

.jlc-theme-inherit .jlc-checkbox-label {
    color: inherit;
}

.jlc-theme-inherit .jlc-submit-btn {
    background: var(--jlc-primary);
    color: var(--wp--preset--color--base, #fff);
}

/* Theme: Minimal */
.jlc-theme-minimal {
    padding: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.jlc-theme-minimal .jlc-input {
    border-radius: 0;
    border: none;
    border-bottom: 2px solid var(--jlc-border);
    padding-left: 0;
    padding-right: 0;
}

.jlc-theme-minimal .jlc-input:focus {
    box-shadow: none;
    border-bottom-color: var(--jlc-primary);
}

.jlc-theme-minimal .jlc-submit-btn {
    border-radius: 0;
}

/* Theme: Rounded */
.jlc-theme-rounded .jlc-input {
    border-radius: 50px;
    padding-left: 20px;
    padding-right: 20px;
}

.jlc-theme-rounded .jlc-textarea {
    border-radius: 20px;
    padding: 16px 20px;
}

.jlc-theme-rounded .jlc-submit-btn {
    border-radius: 50px;
}

/* Responsive */
@media (max-width: 600px) {
    .jlc-form-wrapper {
        padding: 20px;
    }
    .jlc-fields-grid {
        grid-template-columns: 1fr;
    }
    .jlc-field-half {
        grid-column: 1 / -1;
    }
}
