/**
 * Zen Forms - Default Styles
 * Version: 2.0.0
 */

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

/* Field Wrapper */
.zen-form-field {
    margin-bottom: 1.25rem;
}

.zen-form-field-hidden {
    margin: 0;
}

/* Labels */
.zen-form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    color: #374151;
}

.zen-form-field .required {
    color: #dc2626;
    margin-left: 0.125rem;
}

/* Input Base Styles */
.zen-form-field input[type="text"],
.zen-form-field input[type="email"],
.zen-form-field input[type="tel"],
.zen-form-field input[type="url"],
.zen-form-field input[type="number"],
.zen-form-field textarea,
.zen-form-field select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2937;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

/* Placeholder */
.zen-form-field input::placeholder,
.zen-form-field textarea::placeholder {
    color: #9ca3af;
}

/* Focus States */
.zen-form-field input:focus,
.zen-form-field textarea:focus,
.zen-form-field select:focus {
    outline: none;
    border-color: #646B3A;
    box-shadow: 0 0 0 3px rgba(100, 107, 58, 0.15);
}

/* Textarea */
.zen-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Select */
.zen-form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Checkbox */
.zen-form-field-checkbox {
    display: flex;
    align-items: flex-start;
}

.zen-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.5;
}

.zen-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    cursor: pointer;
    accent-color: #646B3A;
    flex-shrink: 0;
}

/* Submit Button */
.zen-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background-color: #646B3A;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    min-width: 160px;
}

.zen-form-submit:hover {
    background-color: #4d5229;
}

.zen-form-submit:active {
    transform: scale(0.98);
}

.zen-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.zen-form-message {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.zen-form-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.zen-form-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Validation States */
.zen-form-field input:invalid:not(:placeholder-shown),
.zen-form-field textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.zen-form-field input:invalid:not(:placeholder-shown):focus,
.zen-form-field textarea:invalid:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Responsive */
@media (max-width: 640px) {
    .zen-form {
        padding: 0 1rem;
    }

    .zen-form-field input[type="text"],
    .zen-form-field input[type="email"],
    .zen-form-field input[type="tel"],
    .zen-form-field textarea,
    .zen-form-field select {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .zen-form-submit {
        width: 100%;
    }
}

/* Dark Mode Support (optional - follows user preference) */
@media (prefers-color-scheme: dark) {
    .zen-form-field label {
        color: #e5e7eb;
    }

    .zen-form-field input[type="text"],
    .zen-form-field input[type="email"],
    .zen-form-field input[type="tel"],
    .zen-form-field textarea,
    .zen-form-field select {
        background-color: #1f2937;
        border-color: #374151;
        color: #f3f4f6;
    }

    .zen-form-field input::placeholder,
    .zen-form-field textarea::placeholder {
        color: #6b7280;
    }

    .zen-checkbox {
        color: #e5e7eb;
    }

    .zen-form-success {
        background-color: #065f46;
        color: #d1fae5;
        border-color: #047857;
    }

    .zen-form-error {
        background-color: #991b1b;
        color: #fee2e2;
        border-color: #b91c1c;
    }
}
