/**
 * FAS Forms - Frontend Styles
 */

.fas-form-wrapper {
    /* Margin controlled by container or Bricks Builder settings */
    display: block;
}

.fas-form {
    /* Width controlled by container or Bricks Builder settings */
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.fas-form-title {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.fas-form-description {
    color: #666;
    margin-bottom: 20px;
}

/* Form Fields */
.fas-form-fields {
    display: flex;
    flex-wrap: wrap;
    /* gap removed - controlled by Bricks Builder "Gap Between Fields" setting */
}

.fas-field {
    box-sizing: border-box;
}

/* Field width classes for horizontal layouts */
/* Using calc() to account for gap spacing */
.fas-field.width-100 {
    flex: 1 1 100%;
}

.fas-field.width-50 {
    /* calc accounts for gap: (100% - gap) / 2 fields */
    /* Default gap is 20px, so 10px per field */
    flex: 0 0 calc(50% - 10px);
}

.fas-field.width-33 {
    /* calc accounts for gap: (100% - 2*gap) / 3 fields */
    /* Default gap is 20px, so 40px total, ~13.33px per field */
    flex: 0 0 calc(33.333% - 13.33px);
}

.fas-field.width-25 {
    /* calc accounts for gap: (100% - 3*gap) / 4 fields */
    /* Default gap is 20px, so 60px total, 15px per field */
    flex: 0 0 calc(25% - 15px);
}

/* Responsive breakpoints */
/* Tablet: 768px and below - Stack 50% fields, convert 33% and 25% to 50% */
@media (max-width: 768px) {
    .fas-field.width-50 {
        flex: 1 1 100%;
    }

    .fas-field.width-33,
    .fas-field.width-25 {
        flex: 0 0 calc(50% - 10px);
    }
}

/* Mobile: 480px and below - All fields become full width */
@media (max-width: 480px) {
    .fas-field.width-50,
    .fas-field.width-33,
    .fas-field.width-25 {
        flex: 1 1 100%;
    }
}

.fas-field-label {
    display: block;
    font-weight: 600;
    /* margin-bottom removed - controlled by Bricks Builder "Label Margin" setting */
}

.fas-required {
    color: #d00;
}

.fas-input,
.fas-textarea,
.fas-select {
    width: 100%;
    /* padding removed - controlled by Bricks Builder "Field Padding" setting */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.fas-textarea {
    /* min-height removed - controlled by Bricks Builder "Textarea Min Height" setting */
    resize: vertical;
}

.fas-checkbox,
.fas-radio {
    margin-right: 8px;
}

.fas-checkbox-label,
.fas-radio-label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
}

.fas-field-error {
    color: #d00;
    font-size: 13px;
    margin-top: 5px;
}

/* Form Footer */
.fas-form-footer {
    /* text-align removed - controlled by Bricks Builder "Button Alignment" setting */
    margin-top: 30px;
}

.fas-submit-button {
    background: #0073aa;
    color: #fff;
    border: none;
    /* padding removed - controlled by Bricks Builder "Button Padding" setting */
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
}

.fas-submit-button:hover {
    background: #005a87;
}

.fas-submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.fas-form-messages {
    margin: 20px 0;
}

.fas-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.fas-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fas-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Honeypot field (hidden spam trap) */
.fas-form-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* File Input - Dropzone */
.fas-file-input {
    padding: 5px;
}

/* Dropzone Styling */
.fas-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fas-dropzone:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.fas-dropzone.dz-drag-hover {
    border-color: #0073aa;
    background: #e6f2ff;
    border-style: solid;
}

.fas-dropzone .dz-message {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.fas-dropzone .dz-icon {
    color: #999;
    opacity: 0.7;
}

.fas-dropzone .dz-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.fas-dropzone .dz-hint {
    font-size: 13px;
    color: #666;
}

/* Dropzone Preview */
.fas-dropzone .dz-preview {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin: 10px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
}

.fas-dropzone .dz-preview.dz-file-preview {
    min-width: 300px;
}

.fas-dropzone .dz-preview .dz-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fas-dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fas-dropzone .dz-preview .dz-details {
    flex: 1;
    min-width: 0;
}

.fas-dropzone .dz-preview .dz-filename {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.fas-dropzone .dz-preview .dz-size {
    font-size: 12px;
    color: #666;
}

.fas-dropzone .dz-preview .dz-progress {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
    display: none;
}

.fas-dropzone .dz-preview.dz-processing .dz-progress {
    display: block;
}

.fas-dropzone .dz-preview .dz-progress .dz-upload {
    display: block;
    height: 100%;
    background: #0073aa;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.fas-dropzone .dz-preview .dz-error-message {
    display: none;
    color: #d00;
    font-size: 12px;
    margin-top: 8px;
}

.fas-dropzone .dz-preview.dz-error .dz-error-message {
    display: block;
}

.fas-dropzone .dz-preview .dz-success-mark,
.fas-dropzone .dz-preview .dz-error-mark {
    display: none;
    position: absolute;
    top: 12px;
    right: 50px;
    font-size: 20px;
    font-weight: bold;
}

.fas-dropzone .dz-preview .dz-success-mark {
    color: #28a745;
}

.fas-dropzone .dz-preview .dz-error-mark {
    color: #dc3545;
}

.fas-dropzone .dz-preview.dz-success .dz-success-mark {
    display: block;
}

.fas-dropzone .dz-preview.dz-error .dz-error-mark {
    display: block;
}

.fas-dropzone .dz-preview .dz-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #dc3545;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.fas-dropzone .dz-preview .dz-remove:hover {
    background: #c82333;
}

/* Hide message when files are present */
.fas-dropzone.dz-started .dz-message {
    display: none;
}

/* Make dropzone compact when files are added */
.fas-dropzone.dz-started {
    padding: 20px;
    min-height: auto;
}
