<div class="input-group {% if attrs.class %}{{ attrs.class }}{% endif %}">
    {% if label %}
    <label for="{{ name }}" class="input-label">{{ label }}</label>
    {% endif %}
    <input
        type="{{ type }}"
        name="{{ name }}"
        id="{{ name }}"
        placeholder="{{ placeholder }}"
        class="input"
        {% if attrs.value %}value="{{ attrs.value }}"{% endif %}
        {% if attrs.required %}required{% endif %}
        {% if attrs.disabled %}disabled{% endif %}
        {% if attrs.readonly %}readonly{% endif %}
    />
</div>

<style>
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}

.input {
    display: flex;
    height: 2.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.input::placeholder {
    color: hsl(var(--muted-foreground));
}

.input:focus {
    outline: none;
    ring: 2px solid hsl(var(--ring));
    ring-offset: 2px;
}

.input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
</style>