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

:root {
    --primary: #F9E79F;
    --secondary: #D4A574;
    --accent: #8B7355;
    --background: #FEFDF7;
    --text: #333;
    --border: #E5DDD0;
    --success: #27AE60;
    --danger: #E74C3C;
    --warning: #F39C12;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 3rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--accent);
    opacity: 0.9;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    header h1 {
        font-size: 2rem;
    }
}

/* FORMULÁRIO */
.form-section,
.result-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-section h2,
.result-section h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--accent);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #999;
    font-size: 0.875rem;
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* BOTÕES */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: var(--accent);
}

.btn-primary:hover {
    background: #F4D03F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 231, 159, 0.4);
}

.btn-lg {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #C4945A;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* LOADING */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* RESULTADO */
.qr-container {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.qr-container img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.qr-info {
    background: var(--background);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.qr-info p {
    margin-bottom: 0.75rem;
}

.qr-info code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    word-break: break-all;
    font-size: 0.85rem;
}

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.actions .btn {
    flex: 1;
    min-width: 120px;
}

/* TABELA */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: var(--primary);
    color: var(--accent);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background: var(--background);
}

.table code {
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* HISTÓRIA */
.history-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-section h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}
