/* ==========================================================================
   Estilos para o Modal Customizado do Moto AI Visualizer
   ========================================================================== */

/* Botão de Abertura */
.moto-visualizer-container #open-moto-ai-modal {
    background-color: #27ae60 !important;
    color: #ffffff !important;
    padding: 15px 30px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(39, 174, 96, 0.2);
}

.moto-visualizer-container #open-moto-ai-modal:hover {
    background-color: #219150 !important;
}

.moto-visualizer-container #open-moto-ai-modal:active {
    transform: translateY(2px);
}

/* ==========================================================================
   Estrutura do Modal (Fundo e Janela)
   ========================================================================== */

#moto-ai-modal-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    display: none; /* Controlado via JS */
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.moto-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.moto-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 480px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 2;
    text-align: center;
    animation: motoModalFadeIn 0.3s ease-out;
}

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

/* Botão Fechar */
#moto-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

#moto-modal-close:hover {
    color: #333;
}

/* ==========================================================================
   Tipografia e Formulário
   ========================================================================== */

.moto-modal-content h3 {
    margin: 0 0 10px 0;
    color: #222;
    font-size: 22px;
    font-weight: 700;
}

.moto-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
}

.moto-input-group {
    margin-bottom: 18px;
    text-align: left;
}

.moto-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
    font-size: 14px;
}

.moto-input-group input {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    background: #f9f9f9 !important;
    color: #333 !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease;
}

.moto-input-group input:focus {
    border-color: #27ae60 !important;
    outline: none !important;
    background: #ffffff !important;
}

#submit-moto-ai {
    width: 100% !important;
    background-color: #27ae60 !important;
    color: #ffffff !important;
    padding: 15px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: pointer;
    text-transform: uppercase;
    border: none;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

#submit-moto-ai:hover {
    background-color: #219150 !important;
}

#submit-moto-ai:disabled {
    background-color: #95a5a6 !important;
    cursor: not-allowed;
}

/* ==========================================================================
   Estados de Carregamento e Resultado
   ========================================================================== */

#moto-ai-loading p {
    color: #555;
    font-weight: 500;
    margin-top: 15px;
}

.moto-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #27ae60;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: moto-spin 1s linear infinite;
    margin: 20px auto 0;
}

@keyframes moto-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#moto-final-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 3px solid #27ae60;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    display: block;
}

.moto-retry-btn {
    background: transparent;
    border: none;
    color: #27ae60;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 10px;
    transition: color 0.2s ease;
}

.moto-retry-btn:hover {
    color: #219150;
}