/* 
 * Professional Form Field Styles for Gophr.io Siteguard
 * Consistent styling for all form inputs across the application
 */

/* Base form input styles */
.form-input {
    appearance: none;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 6px;
    padding: 8px 12px;
    width: 100%;
    font-size: 14px;
    line-height: 1.5;
    color: #111827; /* gray-900 */
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #a855f7; /* primary-500 */
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-input:disabled {
    background-color: #f9fafb; /* gray-50 */
    border-color: #e5e7eb; /* gray-200 */
    color: #6b7280; /* gray-500 */
    cursor: not-allowed;
}

.form-input::placeholder {
    color: #6b7280; /* gray-500 */
}

/* Textarea specific styles */
.form-textarea {
    appearance: none;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 6px;
    padding: 8px 12px;
    width: 100%;
    font-size: 14px;
    line-height: 1.5;
    color: #111827; /* gray-900 */
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    resize: vertical;
    min-height: 80px;
}

.form-textarea:focus {
    outline: none;
    border-color: #a855f7; /* primary-500 */
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-textarea:disabled {
    background-color: #f9fafb; /* gray-50 */
    border-color: #e5e7eb; /* gray-200 */
    color: #6b7280; /* gray-500 */
    cursor: not-allowed;
}

.form-textarea::placeholder {
    color: #6b7280; /* gray-500 */
}

/* Select dropdown styles */
.form-select {
    appearance: none;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 6px;
    padding: 8px 12px;
    padding-right: 32px; /* Space for dropdown arrow */
    width: 100%;
    font-size: 14px;
    line-height: 1.5;
    color: #111827; /* gray-900 */
    background-color: #ffffff;
    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 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus {
    outline: none;
    border-color: #a855f7; /* primary-500 */
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-select:disabled {
    background-color: #f9fafb; /* gray-50 */
    border-color: #e5e7eb; /* gray-200 */
    color: #6b7280; /* gray-500 */
    cursor: not-allowed;
}

/* Checkbox styles */
.form-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 4px;
    background-color: #ffffff;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    position: relative;
}

.form-checkbox:checked {
    background-color: #a855f7; /* primary-500 */
    border-color: #a855f7; /* primary-500 */
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-checkbox:disabled {
    background-color: #f9fafb; /* gray-50 */
    border-color: #e5e7eb; /* gray-200 */
    cursor: not-allowed;
}

/* Radio button styles */
.form-radio {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 50%;
    background-color: #ffffff;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    position: relative;
}

.form-radio:checked {
    background-color: #a855f7; /* primary-500 */
    border-color: #a855f7; /* primary-500 */
}

.form-radio:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

.form-radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-radio:disabled {
    background-color: #f9fafb; /* gray-50 */
    border-color: #e5e7eb; /* gray-200 */
    cursor: not-allowed;
}

/* Form field wrapper styles */
.form-field {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151; /* gray-700 */
    margin-bottom: 4px;
}

.form-label-required::after {
    content: ' *';
    color: #ef4444; /* red-500 */
}

.form-help-text {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280; /* gray-500 */
    line-height: 1.4;
}

.form-error {
    margin-top: 4px;
    font-size: 12px;
    color: #ef4444; /* red-500 */
    line-height: 1.4;
}

/* Error state for form inputs */
.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #ef4444; /* red-500 */
}

.form-input.error:focus,
.form-textarea.error:focus,
.form-select.error:focus {
    border-color: #ef4444; /* red-500 */
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Success state for form inputs */
.form-input.success,
.form-textarea.success,
.form-select.success {
    border-color: #10b981; /* green-500 */
}

.form-input.success:focus,
.form-textarea.success:focus,
.form-select.success:focus {
    border-color: #10b981; /* green-500 */
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Small size variant */
.form-input-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.form-select-sm {
    padding: 6px 10px;
    padding-right: 28px;
    font-size: 12px;
}

/* Large size variant */
.form-input-lg {
    padding: 12px 16px;
    font-size: 16px;
}

.form-select-lg {
    padding: 12px 16px;
    padding-right: 40px;
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}