:root {
    --input-border: #e5e7eb;
    --input-border-focus: #3b82f6;
    --input-border-error: #ef4444;
    --input-bg: #fff;
    --input-text: #111827;
    --input-placeholder: #9ca3af;
    --input-error-text: #ef4444;
    --input-desc-text: #6b7280;
    --input-radius: 6px;
    --input-padding-x: 12px;
    --input-padding-y: 10px;
    --input-height: 2.5rem;
}

.i-field {
    display: flex;
    flex-direction: column;
}

.i-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem;
    font-family: system-ui, sans-serif;
    font-size: 1rem;
    position: relative;
    border: 1px solid #d1d5db;
    padding: 0;
    margin: 0;
    background-color: #fff;
    border-radius: 0.375rem;
    overflow: hidden;
    height: var(--input-height);
}


/* Label: Bold, associated with input */
.i-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.i-label-group {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    gap: 0.25rem;
}

.i-label-secondary {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-weight: 400;
    color: #424242;
}

.i-label-secondary .i-icon svg {
    margin: 0 0.25rem;
    width: 1rem;
    height: auto;
}


.i-input {
    padding: 0 0.75rem;
    background: #fff;
    color: #111827;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    border: none;
    flex-grow: 1;
    height: var(--input-height);
}

.i-wrapper:focus-within {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.i-wrapper-error {
    border-color: var(--input-border-error);
}

.i-field wc-datepicker {
    margin-top: 1rem;
}

.clr-field {
    display: block;
    width: 100%;
}

.clr-field button {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    right: 0.5rem;
    z-index: 10;
}

.clr-field input {
    width: 100%;
}

.i-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.i-input:focus {
    outline: none;
}

.i-input::-webkit-inner-spin-button,
.i-input::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

.i-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
}

.i-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0 0.25rem 0.25rem 0;
    cursor: pointer;
    background-color: transparent;
    flex-shrink: 0;
    width: var(--input-height);
    height: var(--input-height);
    text-align: center;
    transition: background-color 0.15s ease-in-out;
    border: none;
}

.i-action:hover {
    background-color: #eee;
}

.i-icon {
    pointer-events: none;
    line-height: 1;
}

.i-icon svg {
    width: 1.25em;
    height: 1.25em;
    line-height: 1;
}

.i-action-copy .i-action-icon-check {
    display: none;
}

.i-action-copy .i-action-icon-copy {
    display: block;
}

.i-action-copied .i-action-icon-check {
    display: block;
}

.i-action-copied .i-action-icon-copy {
    display: none;
}

.i-prefix,
.i-select-country {
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    align-self: stretch;
    text-align: left;
    border-radius: 0.25rem 0 0 0.25rem;
    padding: 0 0 0 0.5rem;
    cursor: pointer;
    align-self: stretch;
    color: #757575;
    height: var(--input-height);
    border: none;
}

.i-select-country {
    width: intrinsic;
    width: -moz-fit-content;
    width: fit-content;
}

.i-error {
    color: var(--input-error-text);
    border-color: var(--input-border-error);
    display: none;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1rem;
    line-height: 1.25rem;
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid var(--input-border-error);
    border-radius: 4px;
    padding: 0.5rem 1rem;
}

.i-error ul {
    padding-left: 1rem;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    list-style: disc;
}

.i-error-visible {
    display: block;
}

/* Inline variant: Horizontal layout */
.i-wrapper.inline {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.i-wrapper.inline .i-label {
    flex-shrink: 0;
    margin-bottom: 0;
    white-space: nowrap;
}

.i-wrapper.inline .i-input {
    flex: 1;
}

.i-wrapper.inline .i-description,
.i-wrapper.inline .i-error {
    position: absolute;
    left: -9999px;
    /* Hidden off-screen for inline */
}

/* Responsive: Stack on small screens */
@media (max-width: 640px) {
    .i-wrapper.inline {
        flex-direction: column;
        align-items: stretch;
    }
}
