
/**
 * NimoChat Portal - UX Improvements
 * Melhorias incrementais de UX/UI
 * Data: 20/12/2025
 */

/* ============================================
   ACESSIBILIDADE
   ============================================ */

/* Focus visivel para navegacao por teclado */
:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Respeitar preferencia de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   MELHORIAS EM CARDS
   ============================================ */

/* Card destacado (primeiro card) */
.option-card.featured,
.option-card:first-of-type {
    border-color: var(--primary, #2563eb);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
}

.option-card.featured .icon,
.option-card:first-of-type .icon {
    background: var(--primary, #2563eb);
}

.option-card.featured .icon i,
.option-card:first-of-type .icon i {
    color: white;
}

/* Hover aprimorado em cards */
.option-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.option-card:active {
    transform: translateY(-2px);
}

/* Seta animada */
.option-card .arrow {
    transition: all 0.25s ease;
}

.option-card:hover .arrow {
    transform: translateX(6px);
}

/* ============================================
   MELHORIAS EM BOTOES
   ============================================ */

/* Botao com loading */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* Botao primario melhorado */
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Botao WhatsApp */
.btn-whatsapp {
    background: #25D366;
    border-color: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #128C7E;
    border-color: #128C7E;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

/* ============================================
   MELHORIAS EM INPUTS
   ============================================ */

/* Input com foco melhorado */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Input valido */
.form-control.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Input invalido */
.form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Input com icone */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 44px;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-icon-wrapper .form-control:focus + .input-icon,
.input-icon-wrapper .form-control:focus ~ .input-icon {
    color: var(--primary, #2563eb);
}

/* ============================================
   LAYOUT MELHORIAS
   ============================================ */

/* Ajuste de proporcao do split (40/60) */
@media (min-width: 993px) {
    .split-container .brand-side {
        flex: 0 0 40%;
        max-width: 40%;
    }

    .split-container .options-side {
        flex: 0 0 60%;
        max-width: 60%;
    }
}

/* ============================================
   ANIMACOES E TRANSICOES
   ============================================ */

/* Fade in suave */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

/* Slide up */
.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Shake para erros */
.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ============================================
   TOASTS E ALERTAS
   ============================================ */

.toast-container-custom {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease;
    border-left: 4px solid;
}

.toast-success { border-color: #10b981; }
.toast-error { border-color: #ef4444; }
.toast-warning { border-color: #f59e0b; }
.toast-info { border-color: #3b82f6; }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   RESPONSIVIDADE APRIMORADA
   ============================================ */

@media (max-width: 576px) {
    /* Botoes ocupam largura total */
    .btn-mobile-full {
        width: 100%;
    }

    /* Cards com menos padding */
    .option-card {
        padding: 1rem;
    }

    /* Texto menor em mobile */
    .option-card p {
        font-size: 0.85rem;
    }

    /* Icone menor */
    .option-card .icon {
        width: 40px;
        height: 40px;
    }

    .option-card .icon i {
        font-size: 1.25rem;
    }
}

/* ============================================
   UTILITARIOS
   ============================================ */

/* Truncar texto */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Transicoes padrao */
.transition-all {
    transition: all 0.2s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

/* Custom scrollbar */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}


/* ============================================
   AJUSTES FINAIS - 20/12/2025
   ============================================ */

/* Layout 40/60 na pagina inicial */
@media (min-width: 993px) {
    .split-container .brand-side {
        flex: 0 0 40% !important;
        max-width: 40% !important;
    }

    .split-container .options-side {
        flex: 0 0 60% !important;
        max-width: 60% !important;
    }
}

/* Ilustracao SVG */
.home-illustration {
    max-width: 350px;
    margin: 2.5rem auto 0;
    opacity: 0.95;
}

.home-illustration svg {
    width: 100%;
    height: auto;
}

@media (max-width: 992px) {
    .home-illustration {
        display: none;
    }
}

/* Card Destacado - Ja sou cliente */
.option-card-featured {
    border: 2px solid #BFDBFE !important;
    background: linear-gradient(135deg, #F0F9FF 0%, #FFFFFF 100%) !important;
    position: relative;
}

.option-card-featured::before {
    content: "Acesso rapido";
    position: absolute;
    top: -10px;
    right: 20px;
    background: #2563EB;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.option-card-featured:hover {
    border-color: #2563EB !important;
    box-shadow: 0 10px 30px -5px rgba(37, 99, 235, 0.25) !important;
}

.option-card-featured .icon {
    background: #2563EB !important;
}

.option-card-featured .icon i {
    color: white !important;
}

/* Input com icone */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9CA3AF;
    pointer-events: none;
    z-index: 1;
}

.input-with-icon .form-control {
    padding-left: 44px !important;
}

.input-with-icon:focus-within .input-icon {
    color: #2563EB;
}

/* Botao toggle senha */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.password-toggle:hover {
    color: #6B7280;
}

/* Validacao visual com icones embutidos */
.form-control.is-valid {
    border-color: #10B981 !important;
    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='%2310B981' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 44px !important;
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.form-control.is-invalid {
    border-color: #EF4444 !important;
    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='%23EF4444' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 44px !important;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Mensagem de erro */
.form-error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.875rem;
    color: #EF4444;
}

.form-error-message svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Responsividade adicional */
@media (max-width: 768px) {
    .option-card-featured::before {
        font-size: 0.65rem;
        padding: 3px 8px;
        top: -8px;
        right: 12px;
    }
}
