/* CluFo Membership Form  v1.4.5
   Clean two-column layout, light gray placeholders, configurable via CSS variables */

.clufo-membership-form-wrap {
    font-family: var(--cf-font, inherit);
    font-size: var(--cf-font-size, 16px);
    color: var(--cf-text, #1a1a1a);
    background: var(--cf-bg, transparent);
    max-width: 860px;
}

/* ── Success / Error banners ─────────────────────────────── */
.clufo-form-success {
    background: #f0faf4;
    border: 1px solid #46b450;
    border-radius: var(--cf-radius, 6px);
    padding: 20px 24px;
    margin-bottom: 24px;
    text-align: center;
}
.clufo-form-success-icon {
    font-size: 32px;
    color: #46b450;
    margin-bottom: 8px;
}
.clufo-form-success p { margin: 0; font-size: 15px; color: #1a7a3a; }

.clufo-form-error {
    background: #fff0f0;
    border: 1px solid var(--cf-primary, #cc0000);
    border-radius: var(--cf-radius, 6px);
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--cf-primary, #cc0000);
    font-size: 14px;
}

/* ── Group / fieldset ────────────────────────────────────── */
.clufo-form-group {
    border: none;
    margin: 0 0 24px;
    padding: 0;
}
.clufo-form-group-legend {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cf-group, #6b7280);
    padding: 0;
    margin-bottom: 14px;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}
.clufo-form-group-fields {
    display: grid;
    grid-template-columns: repeat(var(--cf-columns, 2), 1fr);
    gap: 16px 24px;
}

/* Fields outside a group — column count from CSS variable (default: 2) */
.clufo-membership-form {
    display: grid;
    grid-template-columns: repeat(var(--cf-columns, 2), 1fr);
    gap: 16px 24px;
    align-items: start;
}
.clufo-membership-form > .clufo-form-group { grid-column: 1 / -1; }
.clufo-membership-form > .clufo-form-submit-wrap { grid-column: 1 / -1; }

/* ── Individual field ────────────────────────────────────── */
.clufo-form-field { display: flex; flex-direction: column; gap: 6px; }
.clufo-form-field--full { grid-column: 1 / -1; }

.clufo-form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--cf-label, #374151);
    line-height: 1.4;
}
.clufo-form-required { color: var(--cf-primary, #cc0000); margin-left: 2px; }
.clufo-form-optional { font-weight: 400; color: #9ca3af; font-size: 13px; margin-left: 4px; }

/* ── Inputs ──────────────────────────────────────────────── */
.clufo-form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--cf-text, #1a1a1a);
    background: var(--cf-input-bg, #ffffff);
    border: 1.5px solid var(--cf-border, #d1d5db);
    border-radius: var(--cf-radius, 6px);
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.5;
}
.clufo-form-input::placeholder {
    color: var(--cf-placeholder, #9ca3af) !important;
    opacity: 1 !important;
}
/* Firefox */
.clufo-form-input::-moz-placeholder {
    color: var(--cf-placeholder, #9ca3af) !important;
    opacity: 1 !important;
}
.clufo-form-input:focus {
    outline: none;
    border-color: var(--cf-primary, #cc0000);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cf-primary, #cc0000) 15%, transparent);
}
.clufo-form-input.clufo-has-error {
    border-color: var(--cf-primary, #cc0000);
}

.clufo-form-select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.clufo-form-textarea { resize: vertical; min-height: 100px; }

/* ── Checkbox ────────────────────────────────────────────── */
.clufo-form-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}
.clufo-form-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--cf-primary, #cc0000);
    cursor: pointer;
}

/* ── Photo upload ────────────────────────────────────────── */
.clufo-photo-input { display: none; }
.clufo-photo-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 1.5px dashed var(--cf-border, #d1d5db);
    border-radius: var(--cf-radius, 6px);
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: border-color .15s, background .15s;
}
.clufo-photo-label:hover {
    border-color: var(--cf-primary, #cc0000);
    background: color-mix(in srgb, var(--cf-primary, #cc0000) 4%, transparent);
    color: var(--cf-primary, #cc0000);
}
.clufo-photo-icon { font-size: 20px; }
.clufo-photo-preview img { max-width: 120px; border-radius: 4px; margin-top: 8px; }

/* ── Field error ─────────────────────────────────────────── */
.clufo-form-field-error {
    font-size: 12px;
    color: var(--cf-primary, #cc0000);
    min-height: 16px;
    line-height: 1.4;
}

/* ── Submit button ───────────────────────────────────────── */
.clufo-form-submit-wrap { margin-top: 8px; }
.clufo-form-submit {
    background: var(--cf-primary, #cc0000);
    color: #fff;
    border: 2px solid var(--cf-primary, #cc0000);
    border-radius: var(--cf-radius, 6px);
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    line-height: 1;
}
.clufo-form-submit:hover  { opacity: .88; }
.clufo-form-submit:active { transform: scale(.98); }
.clufo-form-submit:disabled { opacity: .5; cursor: not-allowed; }
.clufo-form-submit.clufo-loading::after { content: ' ↻'; display: inline-block; animation: clufo-spin .8s linear infinite; }
@keyframes clufo-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .clufo-membership-form,
    .clufo-form-group-fields {
        grid-template-columns: 1fr;
    }
    .clufo-form-field--full { grid-column: 1; }
}
