* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1A2B4D 0%, #2c3e50 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1A2B4D;
    font-size: 0.95em;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-generate {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.preview-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preview-section h2 {
    color: #1A2B4D;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Container do preview - melhor visualização */
.preview-container {
    background: white;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    max-width: 100%;
    position: relative;
}

/* Wrapper para forçar altura fixa */
.preview-container::before {
    content: '';
    display: block;
    width: 830px;
    height: 193px;
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

/* Estilos para a assinatura gerada - dimensões fixas 830x193 */
/*.preview-container table {
    width: 830px !important;
    height: 193px !important;
    max-height: 193px !important;
    margin: 0 auto;
    table-layout: fixed !important;
    flex-shrink: 0;
    overflow: hidden !important;
    display: table !important;
    box-sizing: border-box !important;
    position: relative;
    z-index: 2;
}
*/
/* Forçar células a respeitar altura */
.preview-container table td {
    max-height: 193px !important;
    overflow: hidden !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
}

/* Forçar linhas a respeitar altura */
.preview-container table tr {
    max-height: 193px !important;
    overflow: hidden !important;
}

/* Garantir que imagens mantenham proporção */
.preview-container table img {
    max-width: none !important;
    height: auto !important;
    object-fit: contain;
}

.preview-container table img[width="16"] {
    width: 16px !important;
    height: auto !important;
}

.preview-container table img[style*="height:70px"] {
    height: 70px !important;
    width: auto !important;
}

/* Manter tamanhos fixos de fonte */
.preview-container table div[style*="font-size:20px"] {
    font-size: 20px !important;
}

.preview-container table td[style*="font-size:14px"] {
    font-size: 14px !important;
}

.preview-container table td[style*="font-size:13px"] {
    font-size: 13px !important;
}

.preview-container table div[style*="height:100px"] {
    height: 100px !important;
}

/* Melhorar visualização em telas menores */
@media (max-width: 900px) {
    .preview-container {
        padding: 15px;
    }
    
    .preview-container table {
        transform: scale(0.9);
        transform-origin: center;
    }
}

@media (max-width: 768px) {
    .preview-container {
        padding: 10px;
        overflow-x: auto;
    }
    
    .preview-container table {
        transform: scale(0.8);
        transform-origin: center;
    }
}

.preview-placeholder {
    color: #999;
    text-align: center;
    font-style: italic;
}

.preview-container svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.result-section {
    background: #f8f9fa;
    padding: 40px;
    border-top: 3px solid #667eea;
}

.result-section h2 {
    color: #1A2B4D;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.code-container {
    position: relative;
    margin-bottom: 30px;
}

#htmlCode {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background: #2d2d2d;
    color: #f8f8f2;
    resize: vertical;
    line-height: 1.6;
}

.btn-copy {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-copy.copied {
    background: #28a745;
}

.instructions {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.instructions h3 {
    color: #1A2B4D;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.instructions ol {
    margin-left: 20px;
    line-height: 2;
}

.instructions li {
    margin-bottom: 10px;
    color: #555;
}

.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

