@use '@/styles/base';

.root {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: base.$gap-xs;
    justify-content: center;
    width: 100%;
    height: 100%;

    input::-ms-reveal,
    input::-ms-clear {
        display: none;
    }
}

.wrapper {
    position: relative;
}

.label {
    font-size: base.$font-size-md;
    font-weight: base.$font-weight-md;
    user-select: none;
}

.description {
    font-size: base.$font-size-sm;
    font-weight: base.$font-weight-sm;
    color: base.$font-secondary-color;
    user-select: none;
}

.required {
    color: var(--global-danger-color);
}

.input {
    width: 100%;
    padding: var(--base-gap-sm);
    font-weight: var(--base-font-weight-md);
    line-height: normal;
    color: var(--input-font-color);
    text-align: left;
    background-color: var(--input-background-color);
    border: var(--input-border);
    transition: all 0.15s ease-in-out;

    &:hover,
    &:focus-visible {
        color: var(--input-hover-font-color);
        background-color: var(--input-hover-background-color);
        border: var(--input-hover-border);
    }

    &::placeholder {
        color: var(--input-placeholder-color);
        user-select: none;

        &:hover {
            color: var(--input-hover-placeholder-color);
        }
    }
}

.left-icon {
    left: 0;
    pointer-events: none;
    user-select: none;
}

.right-icon {
    right: 0;
    pointer-events: none;
    user-select: none;
}

.right-section {
    right: 0;
}

.right-section button {
    width: 100%;
    height: 100%;
    padding: 0;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input.left-section {
    padding-left: 2rem;
}

.input.right-section {
    padding-right: 2rem;
}

.section {
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 100%;
    padding: base.$gap-xs;
}

.section[data-position='left'] {
    left: 0;
}

.section[data-position='right'] {
    right: 0;
}

.size-xs {
    font-size: base.$font-size-sm;

    input {
        height: 1.75rem;
    }

    &::placeholder {
        font-size: base.$font-size-sm;
    }
}

.size-sm {
    font-size: base.$font-size-sm;

    input {
        height: 2rem;
    }

    &::placeholder {
        font-size: base.$font-size-sm;
    }
}

.size-md {
    font-size: base.$font-size-md;

    input {
        height: 2.5rem;
    }

    &::placeholder {
        font-size: base.$font-size-md;
    }
}

.size-lg {
    font-size: base.$font-size-lg;

    input {
        height: 3rem;
    }

    &::placeholder {
        font-size: base.$font-size-lg;
    }
}

.size-xl {
    font-size: base.$font-size-xl;

    input {
        height: 3.5rem;
    }

    &::placeholder {
        font-size: base.$font-size-xl;
    }
}

.radius-xs {
    border-radius: base.$border-radius-xs;
}

.radius-sm {
    border-radius: base.$border-radius-sm;
}

.radius-md {
    border-radius: base.$border-radius-md;
}

.radius-lg {
    border-radius: base.$border-radius-lg;
}

.radius-xl {
    border-radius: base.$border-radius-xl;
}
