* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(#00a57c);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 400;
    border-bottom: 2px solid #00a57c;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.required {
    color: #e74c3c;
}

.btn-generate {
    width: 100%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.3);
}

.btn-generate:active {
    transform: translateY(0);
}

.preview-section {
    background: #ffffff;
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    position: relative;
}

.preview-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 400;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.rotulo-preview {
    border: 2px solid #34495e;
    border-radius: 8px;
    padding: 20px;
    background: #ffffff;
    font-family: 'Arial', sans-serif;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.rotulo-preview.size-a4 {
    width: 100%;
    height: 566px;
    font-size: 16px;
}

.rotulo-preview.size-media {
    width: 400px;
    height: 283px;
    font-size: 14px;
}

.rotulo-preview.size-cuarto {
    width: 200px;
    height: 283px;
    font-size: 12px;
}

.rotulo-header {
    text-align: center;
    background: #2c3e50;
    color: white;
    padding: 10px;
    margin: -20px -20px 20px -20px;
    font-weight: bold;
}

.rotulo-section {
    margin-bottom: 15px;
    text-align: left;
}

.rotulo-section h3 {
    background: #ecf0f1;
    padding: 8px 12px;
    margin: 0 -20px 10px -20px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: bold;
    border-left: 4px solid #3498db;
}

.rotulo-section p {
    margin: 5px 0;
    line-height: 1.4;
}

.rotulo-section strong {
    color: #2c3e50;
    font-weight: 600;
}

.empty-preview {
    color: #7f8c8d;
    font-style: italic;
    padding: 50px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.size-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

@media (max-width: 820px) {
    .content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .rotulo-preview.size-a4,
    .rotulo-preview.size-media,
    .rotulo-preview.size-cuarto {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .form-section {
        padding: 20px;
    }

    .preview-section {
        padding: 20px;
    }
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading.show {
    display: flex;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}