/**
* @license   Open Source - Free to use
*/

/* Loading effect pentru câmpuri */
.field-loading {
    position: relative;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.field-loading:before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: #f5f5f5;
    z-index: 1;
}

.field-loading:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 30%;
    background: linear-gradient(90deg, transparent, #f2542d, transparent);
    animation: loading-bar 1.5s ease-in-out infinite;
    z-index: 2;
}

@keyframes loading-bar {
    0% { 
        left: -30%;
        width: 30%;
    }
    50% { width: 50%; }
    100% { 
        left: 100%;
        width: 30%;
    }
}

/* Animație principală de rotire */
@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Icon de loading în dreapta câmpului - NU ESTE FOLOSIT MOMENTAN */
.field-loading input {
    padding-right: 35px !important;
}

.field-loading-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
}

.field-loading-icon:before,
.field-loading-icon:after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background: #f2542d;
    border-radius: 50%;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.field-loading-icon:before {
    left: 0;
}

.field-loading-icon:after {
    right: 0;
    animation-delay: 0.5s;
}

@keyframes dot-pulse {
    0%, 60%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    30% { 
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* Loader pentru orașele în curs de încărcare */
.city-loader {
    color: #f2542d;
    font-size: 12px;
    margin-left: 10px;
    display: inline-block;
    font-style: italic;
}

.city-loader i {
    margin-right: 5px;
}

/* Stilizare buton verificare CUI */
#button-vat {
    background-color: #f2542d;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

#button-vat:hover:not(:disabled) {
    background-color: #060d0d;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

#button-vat:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#button-vat:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#button-vat:before {
    content: "⚡";
    font-size: 16px;
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 5px;
}

#button-vat:hover:not(:disabled):before {
    transform: scale(1.2);
}

#button-vat:disabled:before {
    content: "⟳";
    animation: spin 1s linear infinite;
}

/* Mesajul de notificare pentru localitate */
.anaf-city-notice {
    color: #f2542d !important;
    font-weight: 500;
    background-color: #fff5f3;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #f2542d;
    margin-top: 5px;
    font-size: 13px;
}

/* Loading special pentru select/dropdown */
select.field-loading {
    background-color: #fafafa;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8' stroke='%23f2542d' stroke-width='2' fill='none' stroke-dasharray='12 6' transform='rotate(0 10 10)'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 10 10' to='360 10 10' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 35px) center;
    background-size: 20px 20px;
}

/* Efect de focus pentru câmpurile în loading */
.field-loading:focus {
    outline: none;
    border-color: #f2542d;
    box-shadow: 0 0 0 3px rgba(242, 84, 45, 0.1);
}

/* Animație fade pentru mesaje */
@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(-5px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.city-loader,
.anaf-city-notice {
    animation: fadeIn 0.3s ease-out;
}

/* Fix pentru input fields cu loading bar să nu acopere textul */
.field-loading input,
.field-loading select {
    position: relative;
    z-index: 3;
    background-color: transparent;
}

/* Ascundem butonul implicit */
#button-vat {
    display: none;
}
