/*
 * Form Components
 */

.wishly-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--w-space-2);
}

.wishly-form-label {
    font-size: var(--w-text-sm);
    font-weight: 500;
    color: var(--w-text-primary);
}

.wishly-form-label--required::after {
    content: ' *';
    color: var(--w-error);
}

.wishly-input {
    width: 100%;
    padding: var(--w-space-3) var(--w-space-4);
    background: var(--w-bg-input);
    border: 1px solid var(--w-border-primary);
    border-radius: var(--w-radius-lg);
    color: var(--w-text-primary);
    font-size: var(--w-text-base);
    transition: all var(--w-transition-fast);
}

.wishly-input:hover {
    border-color: var(--w-border-secondary);
}

.wishly-input:focus {
    outline: none;
    border-color: var(--w-accent);
    box-shadow: 0 0 0 3px var(--w-accent-light);
    background: var(--w-bg-card);
}

.wishly-input::placeholder {
    color: var(--w-text-secondary);
}

/* Large input */
.wishly-input--lg {
    padding: var(--w-space-4) var(--w-space-5);
    font-size: var(--w-text-lg);
    border-radius: var(--w-radius-xl);
}

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

/* Select */
.wishly-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--w-space-3) center;
    padding-right: var(--w-space-10);
}

/* Checkbox */
.wishly-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--w-space-3);
    cursor: pointer;
}

.wishly-checkbox__input {
    width: 20px;
    height: 20px;
    border-radius: var(--w-radius-sm);
    border: 2px solid var(--w-border-secondary);
    background: var(--w-bg-input);
    appearance: none;
    cursor: pointer;
    transition: all var(--w-transition-fast);
    flex-shrink: 0;
    margin-top: 2px;
}

.wishly-checkbox__input:checked {
    background: var(--w-accent);
    border-color: var(--w-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.wishly-checkbox__label {
    font-size: var(--w-text-sm);
    color: var(--w-text-secondary);
    line-height: var(--w-leading-normal);
}

/* Error state */
.wishly-input--error {
    border-color: var(--w-error);
}

.wishly-input--error:focus {
    box-shadow: 0 0 0 3px var(--w-error-light);
}

.wishly-form-error {
    font-size: var(--w-text-xs);
    color: var(--w-error);
    display: flex;
    align-items: center;
    gap: var(--w-space-1);
}

/* Valid state (real-time feedback) */
.wishly-input--valid {
    border-color: var(--w-success);
    box-shadow: 0 0 0 3px var(--w-success-light);
}

/* Success state */
.wishly-input--success {
    border-color: var(--w-success);
}

/* Search input with icon */
.wishly-search {
    position: relative;
}

.wishly-search__icon {
    position: absolute;
    left: var(--w-space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--w-text-tertiary);
    pointer-events: none;
}

.wishly-search .wishly-input {
    padding-left: var(--w-space-10);
}

/* Focus-visible for keyboard accessibility */
.wishly-input:focus-visible {
    outline: 2px solid var(--w-accent);
    outline-offset: 1px;
}

.wishly-checkbox__input:focus-visible {
    outline: 2px solid var(--w-accent);
    outline-offset: 2px;
}

.wishly-select:focus-visible {
    outline: 2px solid var(--w-accent);
    outline-offset: 1px;
}
