/**
 * SmartForms Builder - Public Styles
 */

.smartforms-public-page-template {
    margin: 0;
    background: #ffffff;
}

.smartforms-public-page {
    width: min(1120px, calc(100% - 32px));
    margin: 12px auto 40px;
}

.smartforms-public-header {
    margin: 0 auto 22px;
    text-align: center;
}

.smartforms-public-header img {
    display: block;
    width: 100%;
    max-width: 960px;
    max-height: 220px;
    object-fit: contain;
    margin: 0 auto;
}

.smartforms-public-header h1 {
    margin: 0;
    color: #f15a24;
    font-size: 42px;
    line-height: 1.2;
    font-weight: 800;
}

.smartforms-public-header p {
    margin: 10px auto 0;
    max-width: 760px;
    color: #222;
    font-size: 22px;
    line-height: 1.45;
    font-weight: 600;
    white-space: pre-line;
}

.smartforms-public-form-shell {
    border: 2px solid #ff1f10;
    border-radius: 18px;
    padding: 34px 22px 42px;
    background: #fff;
}

.smartforms-public-form-shell .smartforms-style-modern {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.smartforms-public-form-shell .smartforms-submit-wrapper {
    text-align: center;
}

.smartforms-public-form-shell .smartforms-submit-button {
    width: 100%;
    border-radius: 8px;
    background: #ff1f10 !important;
}

/* Main Form Container */
.smartforms-form {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.smartforms-description {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

/* Form Fields */
.smartforms-fields {
    display: grid;
    gap: 20px;
}

.smartforms-field {
    position: relative;
}

.smartforms-field-width-100 {
    grid-column: 1 / -1;
}

.smartforms-field-width-50 {
    grid-column: span 1;
}

/* Layout Variations */
.smartforms-layout-vertical .smartforms-fields {
    grid-template-columns: 1fr;
}

.smartforms-layout-horizontal .smartforms-fields {
    grid-template-columns: 1fr 1fr;
}

.smartforms-layout-grid .smartforms-fields {
    grid-template-columns: repeat(3, 1fr);
}

/* Labels */
.smartforms-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.smartforms-required {
    color: #dc3232;
    margin-left: 3px;
}

/* Inputs */
.smartforms-field input[type="text"],
.smartforms-field input[type="email"],
.smartforms-field input[type="url"],
.smartforms-field input[type="tel"],
.smartforms-field input[type="password"],
.smartforms-field input[type="number"],
.smartforms-field input[type="date"],
.smartforms-field input[type="time"],
.smartforms-field input[type="file"],
.smartforms-field textarea,
.smartforms-field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.smartforms-field input:focus,
.smartforms-field textarea:focus,
.smartforms-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.smartforms-field textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio & Checkbox Groups */
.smartforms-radio-group,
.smartforms-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.smartforms-radio-label,
.smartforms-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.smartforms-radio-label input,
.smartforms-checkbox-label input {
    width: auto;
    margin: 0;
}

.smartforms-radio-label span,
.smartforms-checkbox-label span {
    color: #333;
}

/* Heading & Paragraph */
.smartforms-heading {
    margin: 20px 0 10px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.smartforms-paragraph {
    margin: 10px 0;
    color: #666;
    line-height: 1.6;
}

/* Divider */
.smartforms-divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

/* Field Description */
.smartforms-field .smartforms-description {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    background: none;
    border: none;
    padding: 0;
}

/* Submit Button */
.smartforms-submit-wrapper {
    margin-top: 30px;
    text-align: left;
}

.smartforms-submit-button {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smartforms-submit-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.smartforms-submit-button:active {
    transform: translateY(0);
}

/* Loading Spinner */
.smartforms-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-top: 20px;
}

.smartforms-loading .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.smartforms-success-message {
    margin-top: 20px;
    padding: 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
    font-weight: 600;
}

/* Error Messages */
.smartforms-field-error {
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.smartforms-field.has-error input,
.smartforms-field.has-error textarea,
.smartforms-field.has-error select {
    border-color: #dc3232;
}

.smartforms-field.has-error .smartforms-field-error {
    display: block;
}

/* Style Variations */
.smartforms-style-modern {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.smartforms-style-classic {
    background: #f9f9f9;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.smartforms-style-minimal {
    background: transparent;
    padding: 0;
}

.smartforms-style-minimal .smartforms-field input,
.smartforms-style-minimal .smartforms-field textarea,
.smartforms-style-minimal .smartforms-field select {
    border: none;
    border-bottom: 2px solid #ddd;
    border-radius: 0;
    padding: 10px 0;
    background: transparent;
}

.smartforms-style-minimal .smartforms-field input:focus,
.smartforms-style-minimal .smartforms-field textarea:focus,
.smartforms-style-minimal .smartforms-field select:focus {
    border-bottom-color: #0073aa;
    box-shadow: none;
}

/* Preview Mode */
.smartforms-preview {
    pointer-events: none;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .smartforms-layout-horizontal .smartforms-fields,
    .smartforms-layout-grid .smartforms-fields {
        grid-template-columns: 1fr;
    }
    
    .smartforms-field-width-50 {
        grid-column: 1 / -1;
    }
    
    .smartforms-style-modern {
        padding: 20px;
    }
    
    .smartforms-submit-button {
        width: 100%;
    }
}

/* Dark Mode */
.smartforms-dark-mode .smartforms-form {
    background: #2d3748;
    color: #fff;
}

.smartforms-dark-mode .smartforms-field input,
.smartforms-dark-mode .smartforms-field textarea,
.smartforms-dark-mode .smartforms-field select {
    background: #4a5568;
    border-color: #4a5568;
    color: #fff;
}

.smartforms-dark-mode .smartforms-label {
    color: #e2e8f0;
}

.smartforms-dark-mode .smartforms-description {
    background: #4a5568;
    border-left-color: #63b3ed;
}
