/* ============================================
   COMPONENT: BASE INPUT
   Namespacing: .c-base-input
   ============================================ */

.c-base-input {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 1rem;
}

.c-base-input__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary-color, #20213D);
    margin-bottom: 6px;
    text-align: left;
    font-family: var(--font-secondary, 'Quicksand', sans-serif);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.c-base-input__required {
    color: #EF4444;
    margin-left: 2px;
}

.c-base-input__wrapper {
    position: relative;
    width: 100%;
}

.c-base-input__field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-family: var(--font-secondary, 'Quicksand', sans-serif);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    background: #F9FAFB;
    color: var(--secondary-color);
}

.c-base-input__field:focus {
    border-color: var(--secondary-color, #20213D);
    background: var(--white, #FFFFFF);
    box-shadow: 0 0 0 3px rgba(32, 33, 61, 0.05);
}

.c-base-input__field::placeholder {
    color: #9CA3AF;
}

.c-base-input__field:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

.c-base-input__hint {
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
    display: block;
    line-height: 1.2;
    text-align: left;
}

/* Error State */
.c-base-input--error .c-base-input__field {
    border-color: #EF4444; 
    background-color: #FEF2F2;
}

.c-base-input--error .c-base-input__field:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
}

.c-base-input__error-message {
    color: #EF4444;
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 600;
    display: block;
    text-align: left;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input with Action Wrapper (like Button inside) */
.c-base-input--with-action .c-base-input__wrapper {
    display: flex;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    overflow: hidden;
    background: #F9FAFB;
}

.c-base-input--with-action .c-base-input__wrapper:focus-within {
    border-color: var(--secondary-color, #20213D);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(32, 33, 61, 0.05);
}

.c-base-input--with-action .c-base-input__field {
    border: none;
    background: transparent;
    flex: 1;
}

/* Icon / Toggle Toggle for Password */
.c-base-input__icon-right {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    z-index: 2;
}

.c-base-input__icon-right:hover {
    color: var(--secondary-color);
}

/* Loading State */
.c-base-input__loader {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color, #20213D);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.c-base-input--loading .c-base-input__field {
    padding-right: 2.5rem; /* Make space for the spinner */
    cursor: wait;
}

.c-base-input--loading.c-base-input--with-action .c-base-input__field {
    padding-right: 1rem; /* Reset padding if it has action, action might handle its own or we hide it */
}

