/**
 * Estilos públicos do Vime Contratos
 */

/* Página do contrato - content-area */
.content-area.vime-contratos-page {
    padding: 40px 0 !important;
}

/* Container principal */
.vime-contract-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* Header do contrato */
.vime-contract-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.vime-contract-header h1,
.vime-contract-header h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.vime-contract-meta {
    color: #666;
    font-size: 14px;
}

/* Conteúdo do contrato */
.vime-contract-content {
    margin: 30px 0;
    line-height: 1.8;
    color: #333;
}

.vime-contract-content p {
    margin-bottom: 15px;
}

.vime-contract-content h2,
.vime-contract-content h3 {
    margin: 25px 0 15px 0;
    color: #222;
}

/* Avisos */
.vime-contract-notice {
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: center;
}

.vime-contract-notice h3,
.vime-contract-notice h4 {
    margin-top: 0;
}

.vime-contract-signed {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    animation: vime-fadeInDown 0.5s ease-out;
}

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

/* Base legal */
.vime-contract-legal-basis {
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    padding: 15px 20px;
    margin: 30px 0;
    font-size: 14px;
    color: #555;
}

/* Ações do contrato */
.vime-contract-actions {
    margin: 40px 0;
    padding: 30px;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

.vime-contract-consent {
    margin-bottom: 20px;
}

.vime-contract-consent label {
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
}

.vime-contract-consent input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Botão de assinatura */
.vime-sign-button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vime-sign-button:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.vime-sign-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Formulário de verificação */
.vime-contract-identity-verification {
    max-width: 400px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.vime-contract-identity-verification h2 {
    margin-top: 0;
    text-align: center;
    color: #333;
}

.vime-form-field {
    margin-bottom: 20px;
}

.vime-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.vime-form-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.vime-form-field input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.2);
}

.vime-form-field input.error {
    border-color: #dc3545;
    animation: shake 0.5s;
}

.vime-form-field input.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220,53,69,0.2);
}

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

.vime-form-field small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.vime-verify-button {
    width: 100%;
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.vime-verify-button:hover {
    background: #005a87;
}

/* Informações de assinatura */
.vime-signature-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    margin: 30px 0;
    animation: vime-slideInUp 0.6s ease-out;
}

@keyframes vime-slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vime-signature-info h3 {
    margin-top: 0;
    color: #333;
}

.vime-signature-info p {
    margin: 10px 0;
    color: #555;
}

/* Assinatura digital visual */
.vime-digital-signature {
    margin-top: 60px !important;
    padding: 30px !important;
    border: 2px solid #333 !important;
    background: #f9f9f9 !important;
    text-align: center !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: vime-zoomIn 0.5s ease-out;
}

@keyframes vime-zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vime-digital-signature h3 {
    margin: 0 0 20px 0 !important;
    font-size: 18px !important;
    text-transform: uppercase !important;
    color: #333;
}

/* Assinatura caligráfica */
.vime-signature-handwriting {
    font-family: 'Great Vibes', 'Allura', 'Dancing Script', 'Brush Script MT', cursive;
    font-size: 56px !important;
    color: #1a1a2e;
    margin: 20px 0 40px 0 !important;
    font-weight: 400;
    letter-spacing: 0px;
    transform: rotate(-2deg) skewX(-12deg);
    display: inline-block;
    text-shadow: 1px 2px 3px rgba(0,0,0,0.15);
    position: relative;
    font-style: normal;
    line-height: 0.7;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Linha abaixo da assinatura */
.vime-signature-handwriting::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: -5%;
    width: 110%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #333 10%, 
        #333 90%, 
        transparent 100%
    );
    opacity: 0.4;
    transform: rotate(0.5deg);
}

/* Efeito de caneta */
.vime-signature-handwriting::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, #1a1a2e 30%, transparent 70%);
    border-radius: 50%;
    opacity: 0.2;
    transform: translateY(-50%);
}

.vime-signature-details {
    font-size: 14px;
    color: #666;
    margin-top: 30px;
}

.vime-signature-details p {
    margin: 5px 0 !important;
    line-height: 1.6;
}

/* Footer do contrato */
.vime-contract-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.vime-contract-hash {
    word-break: break-all;
}

.vime-contract-hash code {
    background: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
}

/* Loading */
.vime-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.vime-loading-content {
    text-align: center;
}

.vime-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: vime-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.vime-loading-message {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

/* Barra de progresso */
.vime-progress-bar {
    width: 200px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
}

.vime-progress-fill {
    height: 100%;
    background: #007cba;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 2px;
}

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

/* Spinner inline nos botões */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vime-spin 1s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

/* Mensagens */
.vime-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: center;
}

.vime-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.vime-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Prompt de Geolocalização */
.vime-geolocation-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.vime-geolocation-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    max-width: 500px;
    text-align: center;
    position: relative;
    animation: vime-slideIn 0.3s ease-out;
}

@keyframes vime-slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.vime-geolocation-arrow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 30px solid #ff4444;
    animation: vime-bounce 2s ease-in-out infinite;
}

.vime-geolocation-arrow::after {
    content: '';
    position: absolute;
    top: 30px;
    left: -20px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid #ff4444;
}

@keyframes vime-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.vime-geolocation-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.vime-geolocation-content p {
    margin: 10px 0;
    color: #666;
    font-size: 16px;
}

.vime-geolocation-content strong {
    color: #007cba;
    font-weight: 600;
}

.vime-browser-hint {
    margin-top: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 5px;
}

.vime-browser-hint img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Animação de pulso para botões importantes */
.vime-sign-button:not(:disabled) {
    animation: vime-pulse 2s infinite;
}

@keyframes vime-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 124, 186, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0);
    }
}

/* Transições suaves */
.vime-contract-wrapper * {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Animação para mudança de estado */
.vime-contract-actions.fade-out {
    animation: vime-fadeOut 0.3s ease-out forwards;
}

@keyframes vime-fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Aviso de geolocalização */
.vime-geolocation-notice {
    margin-top: 15px;
    text-align: center;
    color: #666;
}

.vime-geolocation-notice small {
    background: #fff3cd;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* Modal de confirmação personalizado */
.vime-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vime-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.vime-modal.vime-modal-show {
    transform: scale(1);
    opacity: 1;
}

.vime-modal-confirm {
    text-align: center;
    position: relative;
}

.vime-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vime-modal-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

.vime-modal-icon {
    margin: 30px auto 20px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    border-radius: 50%;
    animation: vime-pulse-icon 2s infinite;
}

@keyframes vime-pulse-icon {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.vime-modal-header {
    padding: 0 40px 15px;
}

.vime-modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.vime-modal-body {
    padding: 0 40px 30px;
}

.vime-modal-body p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 16px;
}

.vime-modal-footer {
    padding: 0 40px 30px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Botões do modal */
.vime-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.vime-btn svg {
    width: 16px;
    height: 16px;
}

.vime-btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.vime-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

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

.vime-btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.vime-btn-secondary:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

/* Animação de entrada */
@keyframes vime-modal-bounce {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsivo para modal */
@media (max-width: 600px) {
    .vime-modal {
        max-width: 95%;
        margin: 10px;
    }
    
    .vime-modal-header {
        padding: 0 20px 10px;
    }
    
    .vime-modal-body {
        padding: 0 20px 20px;
    }
    
    .vime-modal-footer {
        padding: 0 20px 20px;
        flex-direction: column;
    }
    
    .vime-btn {
        width: 100%;
    }
}

.vime-btn-warning {
    background: #ff9800;
    color: white;
}

.vime-btn-warning:hover {
    background: #f57c00;
}

/* Modal de aviso */
.vime-modal-warning .vime-modal-icon {
    text-align: center;
    padding: 20px;
}

.vime-modal-warning .vime-modal-header {
    text-align: center;
    border: none;
    padding-top: 0;
}

.vime-modal-warning .vime-modal-body {
    text-align: center;
}

.vime-modal-warning .vime-modal-body p:last-child {
    color: #ff6600;
    font-size: 14px;
}

/* Responsivo */
@media screen and (max-width: 768px) {
    .content-area.vime-contratos-page {
        padding: 20px 0 !important;
    }
    
    .vime-contract-wrapper {
        padding: 15px;
        margin: 0 10px;
    }
    
    .vime-contract-identity-verification {
        padding: 20px;
        margin: 20px auto;
    }
    
    .vime-sign-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .vime-geolocation-content {
        padding: 20px;
        margin: 20px;
    }
    
    .vime-geolocation-arrow {
        display: none;
    }
    
    .vime-modal {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .vime-modal-footer {
        flex-direction: column;
        gap: 5px;
    }
    
    .vime-btn {
        width: 100%;
    }
    
    .vime-contract-actions {
        padding: 20px;
    }
    
    .vime-contract-content {
        margin: 20px 0;
    }
    
    .vime-contract-legal-basis {
        margin: 20px 0;
        padding: 10px 15px;
    }
}