
.nexa-input {
    box-sizing: border-box;
    margin: 0;
    
    white-space: nowrap;       
    overflow: hidden;          
    text-overflow: ellipsis;
    
    display: flex;
    height: 2.25rem; /* calc(var(--spacing) * 9) = 9 * 0.25rem */
    width: 100%;
    border-radius: 0.375rem; /* calc(var(--radius) - 2px) */
    border:2px solid var(--cor-borda, var(--color-gray));
    background-color: white;
    padding: 0.25rem 0.75rem; /* padding-block e padding-inline */
    
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); */
    
    accent-color: var(--text-primary);
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);


    &.-option {
        border:0 solid;
        box-shadow: none;
        z-index:var(--zindex-elements-front);
    }
    &.-p0 {
        padding:0px;
    }
    &.-pv {
        padding-top:1px;
        padding-bottom:1px;
    }
    &.-select {
        width: 100%;
        padding-right: 35px; /* Abre espaço na direita para a seta não cobrir o texto */

        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
        background-repeat: no-repeat;
        background-position: right 12px center; /* Distância da borda direita e centralizado verticalmente */
        background-size: 16px;
        
        cursor: pointer;
    }
}


.-option:hover {
    background-color: var(--color-graylight);
    cursor: pointer;
}

input[type="date"] {
  position: relative;
  padding-right: 40px;
}

textarea {
    resize: vertical !important;  /* Permite redimensionar verticalmente */
    max-height: 400px !important;  /* Altura máxima (opcional) */
    white-space: pre-wrap !important;
    width: 100%; /* Garanta que ele tenha uma largura limite definida */
}


input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 4px;
  /* margin-right: 8px; */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
}

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

.nexa-input:focus {
    outline: none;
    border: 2px solid var(--color-gray);
}

.nexa-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-hover);
}

.nexa-text {
    text-decoration: none !important;
    display: inline-flex;  /* Ou 'flex' se for ocupar a largura toda */
    align-items: center;
    gap: 8px;
    
    &.-detail {
        color:var(--nexa-primary);
        letter-spacing:4px;
        font-weight: 500;
        text-transform: uppercase;
    }
    &.-subdesc {
        color:var(--text-secondary) !important;
    }
    &.-strong {
        font-weight: 700;
    }
    &.-subfont {
        font-family: var(--font-secondary);
    }
    &.-right {
        text-align: right;
    }
    &.-center {
        text-align: center;
    }
    &.-warning {color:var(--color-warning);}
    &.-error {color:var(--color-error);}
    &.-sucess {color:var(--color-sucess);}
    &.-purple {color:var(--color-purple);}
    &.-nexa {color:var(--color-nexa);}
    &.-white {color:var(--color-white);}
    &.-gray {color:var(--text-secondary);}
    &.-decoration {text-decoration:underline;}
    &.-sizeup {font-size:200%;}
    &.-sizedown {font-size:50%;}
    &.-upper {text-transform:uppercase;}
    &.-fill {white-space: nowrap;}
    &.-pulse-glow {    
        background: linear-gradient(
                        90deg,
                        #487ffa 0%,
                        #4da3ff 25%,
                        #6eb4ff 50%,
                        #4da3ff 75%,
                        #487ffa 100%
                    );
        background-size: 200% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: shimmer 2.5s linear infinite;
    }
    &.-note {
        --note-color: var(--color-nexa);
        position: relative;
        display: block;
        padding: 0 0.6rem 0 0.6rem;
        border-radius: var(--radius-sm);
        background-color: color-mix(in srgb, var(--note-color) 10%, transparent);
    }
    &.-info {
        --tip-gap: 2px;

        position: relative;
        cursor: help;
        outline: none;

        /* Balão: sempre ancorado no centro do ícone */
        &::after {
            content: attr(data-info);
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(
                calc(-50% + var(--tip-x, 0px)),
                calc(-50% + var(--tip-y, 0px))
            );

            width: max-content;
            max-width: 240px;
            padding: 0.5rem 0.75rem;
            border-radius: var(--radius-sm);
            background-color: var(--color-dark);
            color: var(--color-white);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

            font-family: var(--font-primary);
            font-size: 0.78rem;
            font-weight: 400;
            line-height: 1.45;
            text-align: left;
            white-space: normal;

            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
            z-index: 999999;
        }

        /* Seta */
        &::before {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);

            border-style: solid;
            border-width: 6px;
            border-color: transparent;

            opacity: 0;
            visibility: hidden;
            transition: opacity 0.15s, visibility 0.15s;
            z-index: 999999;
        }

        &:hover::after,
        &:focus-visible::after,
        &:hover::before,
        &:focus-visible::before {
            opacity: 1;
            visibility: visible;
        }

        /* ---------- Direções: cada uma define só o deslocamento ---------- */

        /* Vertical */
        &.--top    { --tip-y: calc(-50% - var(--tip-gap)); }
        &.--bottom { --tip-y: calc(50% + var(--tip-gap)); }

        /* Horizontal */
        &.--left   { --tip-x: calc(-50% - var(--tip-gap)); }
        &.--right  { --tip-x: calc(50% + var(--tip-gap)); }

        /* Combinações: --bottom --right, --top --left, etc. já funcionam */
        /* Seta: posicionada na borda do balão, apontando para o ícone */
        /* &.--top::before    { transform: translate(-50%, calc(-50% + var(--tip-y)/2 ...)); } */
    }
}

.nexa-text.-note::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px;
    background-color: var(--note-color);
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.nexa-shadow {
    box-shadow: 0 2px 8px rgba(2, 0, 34, 0.15) !important;
}

.nexa-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;

    input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

    .nexa-switch-slider {
        position: absolute;
        inset: 0;
        background-color: var(--border-color, #ccc);
        border-radius: 999px;
        transition: background-color 150ms;

        /* bolinha */
        &::before {
            content: "";
            position: absolute;
            width: 18px;
            height: 18px;
            left: 3px;
            top: 50%;
            transform: translateY(-50%);
            background-color: #fff;
            border-radius: 50%;
            transition: transform 150ms;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        }
    }

    /* Ativo */
    input:checked + .nexa-switch-slider {
        background-color: var(--color-nexa);
    }

    input:checked + .nexa-switch-slider::before {
        transform: translateY(-50%) translateX(20px);
    }

    /* Desabilitado */
    &.-disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

.nexa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    white-space: nowrap;
    border-radius: 0.6rem;

    font-size: 0.90rem;
    font-weight: 600;
    color: var(--text-primary);

    line-height: 1;
    cursor: pointer;
    transition-property: color, background-color, border-color;
    transition-duration: 150ms;

    background-color: #fff;
    padding: 0.4rem 0.90rem;

    font-family:var(--font-primary);
    &.-ellipsis {
        overflow: hidden;
        text-overflow: ellipsis; 
        max-width: 100%;         
        display: block;
    }
    &.-disabled {
        opacity: 0.6;
        cursor: not-allowed;
        pointer-events: none;
        box-shadow: none;
    }
    &.-tag {
        cursor: not-allowed;
        pointer-events: none;
        box-shadow: none;
    }
    &.-limit {
        max-height:35.4px;
        min-height:35.4px;
        height:35.4px;
    }
    &.-limitw {
        max-width:fit-content;
    }
    &.-p0 {
        padding:0;
    }
    &.-dark {
        background-color: var(--color-dark);
        /* border: 1px solid #dddddd; */
        color: var(--color-white);
        svg {
            color: var(--color-white);
        }
    }
    &.-img-dark {
        img {
            filter: brightness(0) saturate(100%);
        }
    }
    &.-img-white {
    img {
        filter: brightness(0) invert(1);
    }
    }
    &.-inverter {
        img {
            filter: invert(1);
        }
    }
    &.-twarning {
        color:var(--color-warning);
        svg {
            color:var(--color-warning);
        }
    }
    &.-terror {
        color:var(--color-error);
        svg {
            color:var(--color-error);
        }
    }
    &.-tsucess {
        color:var(--color-sucess);
        svg {
            color:var(--color-sucess);
        }
    }
    &.-tnexa {
        color:var(--color-nexa);
        svg {
            color:var(--color-nexa);
        }
    }
    &.-tpurple {
        color:var(--color-purple);
        svg {
            color:var(--color-purple);
        }
    }
    &.-bwarning {
        background-color:var(--color-warning);
    }
    &.-berror {
        background-color:var(--color-error);
    }
    &.-bsucess {
        background-color:var(--color-sucess);
    }
    &.-bnexa {
        background-color:var(--color-nexa);
    }
    &.-bpurple {
        background-color:var(--color-purple);
    }
    &.-fill {
        flex: 1 1 auto;
        min-height: 0;
        min-width: 0;
    }
    &.-tab {
        background: transparent;
        color:var(--text-secondary);
        border: 1px solid #c9c7cf;
        
        &:hover {
            background: transparent;
            color:var(--text-secondary);
        }

        svg {
            color:var(--text-secondary);
        }
        &.--active {
            background: white;
            color:var(--text-primary);
            border: none;
            svg {
                color:var(--text-primary);
            }
        }
    }
    &.-sizedown {
        font-size: 0.80rem;
        svg {
            width: 1rem;
            height: 1rem;
        }
        i {
            font-size: 1rem;
        }
    }
    &.-sizeup {
        font-size: 1rem;
        svg {
            width: 1.5rem;
            height: 1.5rem;
        }
        i {
            font-size: 1.5rem;
        }
    }
    &.-upper {
        text-transform:uppercase;
    }
    &.-border {
        border: 1px solid var(--color-dark);
    }
}

.nexa-btn:hover {
    background-color: #e6e8f7;
    color: var(--accent-foreground);

    svg {
        color: var(--accent-foreground);
    }
}

.nexa-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

svg, i {
    /* color: var(--text-secondary); */
    margin:0px !important;
}

.nexa-btn svg {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    width: 1.3rem;
    height: 1.3rem;
    color: var(--text-primary);
}

.nexa-btn img {
    justify-content: center;
    max-width:64px;
    height: auto;
    object-fit:contain;
}

.nexa-check {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #ccc);
    border-radius: 4px;
    background-color: var(--card-bg, #fff);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 150ms, border-color 150ms;
    position: relative;

    &:checked {
        background-color: var(--color-nexa);
        border-color: var(--color-nexa);

        /* checkmark */
        &::after {
            content: "";
            position: absolute;
            left: 4px;
            top: 1px;
            width: 5px;
            height: 9px;
            border: 2px solid #fff;
            border-top: none;
            border-left: none;
            transform: rotate(45deg);
        }
    }

    &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
}


/* ============================================================
   nexa-file: área de upload
   ============================================================ */

.nexa-file {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.5rem 1rem;
    border: 2px dashed var(--color-gray);
    border-radius: 0.6rem;
    background-color: transparent;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition:
        border-color var(--transition),
        background-color var(--transition),
        box-shadow var(--transition);
}

/* O input cobre toda a área: clicar em qualquer ponto abre o seletor */
.nexa-file input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.nexa-file-icon {
    width: 2rem;
    height: 2rem;
    color: var(--color-nexa);
}

.nexa-file-title {
    color: var(--text-primary);
    font-weight: 600;
}

.nexa-file-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Hover e arraste */
.nexa-file:hover,
.nexa-file.is-dragover {
    border-color: var(--color-nexa);
    background-color: color-mix(in srgb, var(--color-nexa) 6%, white);
}

/* Foco por teclado */
.nexa-file:focus-within {
    border-style: solid;
    border-color: var(--color-nexa);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-nexa) 20%, transparent);
}

/* Desabilitado */
.nexa-file:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}