/**
 * FlowForm — Frontend form styles.
 *
 * Minimal, clean, responsive. Designed to blend with any theme
 * while providing a polished default appearance.
 *
 * Includes a 12-column grid system for field layout.
 */

.flowform-container {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
}

/* Loading & error states */
.ff-loading,
.ff-error {
    padding: 24px;
    text-align: center;
    color: #666;
}
.ff-error {
    color: #dc3545;
}

/* ── GRID SYSTEM ── */
.ff-form.ff-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px 16px;
}

/* Desktop (default) */
.ff-form.ff-grid .ff-col-d-12 { grid-column: span 12; }
.ff-form.ff-grid .ff-col-d-6  { grid-column: span 6; }
.ff-form.ff-grid .ff-col-d-4  { grid-column: span 4; }

/* Tablet: max-width 1024px */
@media (max-width: 1024px) {
    .ff-form.ff-grid .ff-col-t-12 { grid-column: span 12 !important; }
    .ff-form.ff-grid .ff-col-t-6  { grid-column: span 6 !important; }
    .ff-form.ff-grid .ff-col-t-4  { grid-column: span 4 !important; }
}

/* Mobile: max-width 640px */
@media (max-width: 640px) {
    .ff-form.ff-grid .ff-col-m-12 { grid-column: span 12 !important; }
    .ff-form.ff-grid .ff-col-m-6  { grid-column: span 6 !important; }
    .ff-form.ff-grid .ff-col-m-4  { grid-column: span 4 !important; }
}

/* Field wrapper */
.ff-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* Prevent grid blowout */
}

/* Labels */
.ff-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.ff-required {
    color: #dc3545;
}

/* Inputs */
.ff-input,
.ff-select,
.ff-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.ff-input:focus,
.ff-select:focus,
.ff-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Radio & Checkbox */
.ff-radio-label,
.ff-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
    padding: 4px 0;
}
.ff-radio,
.ff-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Consent field */
.ff-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    padding: 8px 0;
}
.ff-consent-checkbox {
    margin-top: 3px;
    flex-shrink: 0;
}
.ff-consent-text {
    color: #444;
}
.ff-consent-text a {
    color: #2563eb;
    text-decoration: underline;
}
.ff-consent-text a:hover {
    color: #1d4ed8;
}

/* Submit button */
.ff-submit {
    display: inline-block;
    padding: 12px 32px;
    background: #2563eb;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.ff-submit:hover {
    background: #1d4ed8;
}
.ff-submit:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* Field errors */
.ff-field-error {
    font-size: 13px;
    color: #dc3545;
    min-height: 0;
}
.ff-field-error:empty {
    display: none;
}

/* Messages */
.ff-message {
    padding: 16px 20px;
    border-radius: 6px;
    font-size: 15px;
    margin-top: 12px;
}
.ff-message:empty {
    display: none;
}
.ff-message--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.ff-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 480px) {
    .flowform-container {
        font-size: 15px;
    }
    .ff-input,
    .ff-select,
    .ff-textarea {
        padding: 10px 12px;
    }
    .ff-submit {
        width: 100%;
    }
}
