/**
 * LemonT Forms Frontend Styles v2.0
 */

/* ===== Form Wrapper ===== */
.lemont-form-wrapper {
    --primary-color: #10b981;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --bg-color: #ffffff;
    --error-color: #ef4444;
    --success-color: #10b981;
}

.lemont-form,
.lemont-custom-form {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== Honeypot ===== */
.lemont-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* ===== Form Fields ===== */
.lemont-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-col {
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-col {
        flex: 1 1 100% !important;
    }
}

/* ===== Field Styles ===== */
.lemont-field {
    margin-bottom: 0;
}

.lemont-field .field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.lemont-field .required {
    color: var(--error-color);
    margin-left: 2px;
}

.lemont-field input[type="text"],
.lemont-field input[type="email"],
.lemont-field input[type="tel"],
.lemont-field input[type="url"],
.lemont-field input[type="number"],
.lemont-field input[type="date"],
.lemont-field textarea,
.lemont-field select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.lemont-field input:focus,
.lemont-field textarea:focus,
.lemont-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.lemont-field input::placeholder,
.lemont-field textarea::placeholder {
    color: #9ca3af;
}

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

.lemont-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

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

.radio-option,
.checkbox-option,
.checkbox-single {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
}

.radio-option input,
.checkbox-option input,
.checkbox-single input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.02);
}

.file-upload .file-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}

/* Field Error */
.field-error {
    margin-top: 6px;
    font-size: 13px;
    color: var(--error-color);
    display: none;
}

.lemont-field.has-error input,
.lemont-field.has-error textarea,
.lemont-field.has-error select {
    border-color: var(--error-color);
}

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

/* ===== Submit Button ===== */
.lemont-form-submit {
    margin-top: 24px;
}

.lemont-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lemont-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.lemont-submit-btn:active {
    transform: translateY(0);
}

.lemont-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.lemont-submit-btn .btn-loading {
    display: none;
}

.lemont-submit-btn.is-loading .btn-text {
    display: none;
}

.lemont-submit-btn.is-loading .btn-loading {
    display: flex;
}

.lemont-submit-btn .spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Form Messages ===== */
.lemont-form-messages {
    margin-top: 20px;
}

.form-success,
.form-error {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.form-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #059669;
}

.form-success.show {
    display: block;
}

.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.form-error.show {
    display: block;
}

/* ===== Custom Form Styles ===== */
.lemont-custom-wrapper .lemont-custom-form input[type="text"],
.lemont-custom-wrapper .lemont-custom-form input[type="email"],
.lemont-custom-wrapper .lemont-custom-form input[type="tel"],
.lemont-custom-wrapper .lemont-custom-form input[type="url"],
.lemont-custom-wrapper .lemont-custom-form input[type="number"],
.lemont-custom-wrapper .lemont-custom-form textarea,
.lemont-custom-wrapper .lemont-custom-form select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.lemont-custom-wrapper .lemont-custom-form input:focus,
.lemont-custom-wrapper .lemont-custom-form textarea:focus,
.lemont-custom-wrapper .lemont-custom-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.lemont-custom-wrapper .lemont-custom-form button[type="submit"],
.lemont-custom-wrapper .lemont-custom-form input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lemont-custom-wrapper .lemont-custom-form button[type="submit"]:hover,
.lemont-custom-wrapper .lemont-custom-form input[type="submit"]:hover {
    opacity: 0.9;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .lemont-field input,
    .lemont-field textarea,
    .lemont-field select {
        padding: 10px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .lemont-submit-btn {
        width: 100%;
    }
}
