/* YanForms Frontend Styles */
:root {
    --yf-primary: #e74c3c;
    --yf-primary-dark: #c0392b;
    --yf-success: #27ae60;
    --yf-danger: #e74c3c;
    --yf-dark: #2c3e50;
    --yf-gray: #7f8c8d;
    --yf-light: #f8f9fa;
    --yf-white: #ffffff;
    --yf-border: #ddd;
    --yf-radius: 6px;
}

.yanforms-container {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.yanforms-form {
    background: var(--yf-white);
    padding: 30px;
    border-radius: var(--yf-radius);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
}

/* Field Size - Column Widths */
.yanforms-field {
    margin-bottom: 24px;
    width: 100%;
    /* Default full width */
}

.yanforms-field.yanforms-size-small {
    width: calc(33.333% - 14px);
    /* 1/3 column */
}

.yanforms-field.yanforms-size-medium {
    width: calc(50% - 10px);
    /* 1/2 column */
}

.yanforms-field.yanforms-size-large {
    width: 100%;
    /* Full width */
}

/* Name field layout */
.yanforms-name-wrap {
    display: flex;
    gap: 15px;
}

.yanforms-name-wrap>div {
    flex: 1;
}

.yanforms-sublabel {
    display: block;
    font-size: 12px;
    color: var(--yf-gray);
    margin-top: 4px;
}

/* Address field layout */
.yanforms-address-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yanforms-address-row {
    display: flex;
    gap: 10px;
}

.yanforms-address-city {
    flex: 2;
}

.yanforms-address-state {
    flex: 1;
}

.yanforms-address-zip {
    flex: 1;
}

/* Submit button full width */
.yanforms-submit-wrap {
    width: 100%;
}

/* Responsive - stack on mobile */
@media (max-width: 768px) {

    .yanforms-field.yanforms-size-small,
    .yanforms-field.yanforms-size-medium {
        width: 100%;
    }

    .yanforms-name-wrap {
        flex-direction: column;
    }

    .yanforms-address-row {
        flex-direction: column;
    }
}

.yanforms-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--yf-dark);
    font-size: 14px;
}

.yanforms-required {
    color: var(--yf-danger);
    margin-left: 2px;
}

.yanforms-input,
.yanforms-textarea,
.yanforms-select,
.yanforms-date,
.yanforms-time,
.yanforms-datetime {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--yf-border);
    border-radius: var(--yf-radius);
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--yf-white);
}

.yanforms-input:focus,
.yanforms-textarea:focus,
.yanforms-select:focus {
    border-color: var(--yf-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.yanforms-input.error,
.yanforms-textarea.error,
.yanforms-select.error {
    border-color: var(--yf-danger);
}

.yanforms-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Radio & Checkbox */
.yanforms-radio-group,
.yanforms-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yanforms-radio-label,
.yanforms-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    background: var(--yf-light);
    border-radius: var(--yf-radius);
    transition: background 0.2s;
}

.yanforms-radio-label:hover,
.yanforms-checkbox-label:hover {
    background: #eee;
}

.yanforms-radio,
.yanforms-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--yf-primary);
}

/* File Upload */
.yanforms-file-wrap {
    position: relative;
}

.yanforms-file {
    width: 100%;
    padding: 20px;
    border: 2px dashed var(--yf-border);
    border-radius: var(--yf-radius);
    background: var(--yf-light);
    cursor: pointer;
}

.yanforms-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.yanforms-file-preview-item {
    padding: 8px 12px;
    background: var(--yf-light);
    border-radius: 4px;
    font-size: 13px;
}

/* Description */
.yanforms-description {
    font-size: 13px;
    color: var(--yf-gray);
    margin-top: 6px;
}

/* Field Error */
.yanforms-field-error {
    color: var(--yf-danger);
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.yanforms-field-error.show {
    display: block;
}

/* Submit Button */
.yanforms-submit-wrap {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.yanforms-submit-btn {
    background: var(--yf-primary);
    color: var(--yf-white);
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--yf-radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.yanforms-submit-btn:hover {
    background: var(--yf-primary-dark);
}

.yanforms-submit-btn:active {
    transform: scale(0.98);
}

.yanforms-submit-btn:disabled {
    background: var(--yf-gray);
    cursor: not-allowed;
}

/* Spinner */
.yanforms-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid var(--yf-light);
    border-top-color: var(--yf-primary);
    border-radius: 50%;
    animation: yf-spin 0.8s linear infinite;
}

.yanforms-spinner.show {
    display: block;
}

@keyframes yf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Response Messages */
.yanforms-response {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: var(--yf-radius);
    display: none;
}

.yanforms-response.show {
    display: block;
}

.yanforms-response.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.yanforms-response.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Divider */
.yanforms-divider {
    border: none;
    border-top: 1px solid var(--yf-border);
    margin: 30px 0;
}

/* Heading */
.yanforms-heading {
    color: var(--yf-dark);
    margin-bottom: 15px;
}

/* HTML Content */
.yanforms-html-content {
    line-height: 1.6;
}

/* Error State */
.yanforms-error {
    color: var(--yf-danger);
    padding: 15px;
    background: #f8d7da;
    border-radius: var(--yf-radius);
}

/* Conditional Fields */
.yanforms-field[data-conditional].hidden {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .yanforms-form {
        padding: 20px;
    }

    .yanforms-submit-btn {
        width: 100%;
    }
}