/* Inputs - Unified Input System */

/* Required Field Indicator */
.required {
    color: var(--error, #dc2626);
    font-weight: 500;
    font-size: 12px;
    line-height: 1;
    display: inline-block;
    height: 12px;
    vertical-align: middle;
    margin-left: 2px;
}

/* Required field indicator - removed per user request */
/* input[type="text"][required],
input[type="email"][required],
input[type="tel"][required],
input[type="number"][required],
textarea[required] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ctext x='0' y='11' fill='%23dc2626' font-size='12' font-weight='500'%3E•%3C/text%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 12px;
    padding-right: 24px !important;
}

textarea[required] {
    background-position: right 8px top 8px;
}

input[type="date"][required] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ctext x='0' y='11' fill='%23dc2626' font-size='12' font-weight='500'%3E•%3C/text%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 12px;
    padding-right: 24px !important;
}

.form-group input[required],
.form-group textarea[required] {
    background-image: none !important;
    padding-right: var(--input-padding-x) !important;
} */

/* Input with datalist - normalize browser styling and hide picker indicators */
input[list] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Hide datalist dropdown arrow in Chrome/Safari */
input[list]::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

/* Hide datalist dropdown arrow in Chrome (alternative method) */
input[list]::-webkit-list-button {
    display: none !important;
    opacity: 0;
}

/* Hide datalist dropdown arrow in Firefox */
input[list]::-moz-list-button {
    display: none !important;
}

/* Additional datalist styling normalization */
input[type="text"][list] {
    appearance: textfield;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
}

/* Currency input - narrow width for 3-character codes */
.currency-input {
    width: 4rem !important;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
}

/* Language input - narrow width for 2-character language codes */
.language-input {
    width: 4rem !important;
    text-align: center;
    font-weight: 500;
    text-transform: lowercase;
}

.language-input::placeholder {
    text-transform: none;
}

/* Country input - narrow width for 2-character ISO codes */
.country-input {
    width: 100%;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
}

.country-input::placeholder {
    text-transform: none;
}

/* Base Input */
.input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    height: var(--size-md);
    padding: 0 var(--input-padding-x);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--input-font-size);
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

/* Textarea */
textarea {
    height: auto;
    padding: var(--space-2);
    resize: none; /* Disable resize handle by default */
    line-height: 1.4;
}

/* Input Focus State */
.input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-subtle);
}

/* Input Placeholder */
.input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

/* Input Sizes */
.input--sm {
    height: var(--size-sm);
    padding: 0 var(--space-1);
    font-size: var(--font-size-sm);
}

.input--lg {
    height: var(--size-lg);
    padding: 0 var(--space-3);
    font-size: var(--font-size-md);
}

/* Input Widths */
.input--width-sm {
    width: var(--input-width-sm);
}

.input--width-md {
    width: var(--input-width-md);
}

.input--width-lg {
    width: var(--input-width-lg);
}

/* Input with Button (composite input) */
.input-with-btn {
    display: flex;
    gap: var(--space-1);
}

.input-with-btn input {
    flex: 1;
    min-width: 0;
}

/* Number Input - Hide Spin Buttons */
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

/* Auto-growing Textarea */
.textarea--auto-grow {
    min-height: var(--size-md);
    resize: none;
    overflow: hidden;
    field-sizing: content;
}

/* Validation States */
.input--invalid,
input.invalid,
input:invalid.touched,
select:invalid.touched,
textarea:invalid.touched {
    border-color: var(--error);
}

.input--invalid:focus,
input.invalid:focus,
input:invalid.touched:focus,
select:invalid.touched:focus,
textarea:invalid.touched:focus {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

/* Form validation on submit */
form.show-validation input:invalid,
form.show-validation select:invalid,
form.show-validation textarea:invalid {
    border-color: var(--error);
}

/* Legacy class names */
.line-item-desc {
    width: 100%;
    min-height: var(--size-md);
    padding: var(--space-3) var(--space-2);
    font-size: var(--font-size-base);
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    resize: none;
    overflow: hidden;
    line-height: 1.4;
    field-sizing: content;
}

/* Required field indicator for textarea description - removed per user request */
/* .line-item-desc[required] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ctext x='0' y='11' fill='%23dc2626' font-size='12' font-weight='500'%3E•%3C/text%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px top 8px;
    background-size: 12px 12px;
    padding-right: 24px !important;
} */

.line-item-desc:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-subtle);
}

.line-item-desc::placeholder {
    color: var(--text-light);
}

.line-item-qty,
.line-item-price {
    appearance: textfield;
    -moz-appearance: textfield;
}

.line-item-qty::-webkit-outer-spin-button,
.line-item-qty::-webkit-inner-spin-button,
.line-item-price::-webkit-outer-spin-button,
.line-item-price::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

.line-item-unit {
    text-align: center;
    font-size: var(--font-size-sm);
    padding: 0 var(--space-1);
}

#notes {
    width: 100%;
    margin-top: 0;
    padding: var(--space-2);
    font-size: var(--input-font-size);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: none;
    min-height: 48px;
}

#notes:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-subtle);
}

#notes::placeholder {
    color: var(--text-light);
}

