/* Guias de Atendimento - Frontend Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f1f7 100%);
    color: #333;
    line-height: 1.6;
}

.guias-form-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 100vh;
}

/* Form Section */
.form-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.form-header {
    margin-bottom: 30px;
    border-bottom: 3px solid #004b87;
    padding-bottom: 20px;
}

.form-header h1 {
    color: #004b87;
    font-size: 24px;
    margin-bottom: 5px;
}

.form-header .subtitle {
    color: #666;
    font-size: 14px;
}

.status-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
    border-left: 4px solid;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #f5c6cb;
    display: block;
}

/* Form Styles */
.guias-form {
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #004b87;
    box-shadow: 0 0 0 3px rgba(0, 75, 135, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #004b87;
    color: white;
}

.btn-primary:hover {
    background: #003d6b;
    box-shadow: 0 4px 12px rgba(0, 75, 135, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

/* Preview Section */
.preview-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.preview-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #004b87;
    padding-bottom: 10px;
}

.preview-header h2 {
    color: #004b87;
    font-size: 18px;
}

.preview-pdf {
    background: white;
    border: 2px solid #004b87;
    padding: 25px;
    border-radius: 4px;
}

.preview-pdf .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 3px solid #004b87;
    padding-bottom: 15px;
}

.logo-space {
    width: 70px;
    height: 70px;
    background: #f0f0f0;
    border: 2px dashed #004b87;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #999;
    border-radius: 4px;
}

.header-info {
    flex: 1;
    text-align: center;
    margin: 0 20px;
}

.header-info h1 {
    color: #004b87;
    font-size: 18px;
    margin-bottom: 3px;
}

.header-info p {
    font-size: 11px;
    color: #666;
}

.numero-guia {
    text-align: right;
}

.numero-guia p {
    font-size: 11px;
    color: #666;
}

.numero-guia .numero {
    font-size: 22px;
    font-weight: bold;
    color: #004b87;
}

.table-preview {
    width: 100%;
    margin-bottom: 15px;
    border-collapse: collapse;
}

.table-preview th,
.table-preview td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
}

.table-preview th {
    background: #004b87;
    color: white;
    font-weight: 600;
}

.table-preview tr:nth-child(even) {
    background: #f9f9f9;
}

.label-bold {
    font-weight: 600;
    color: #004b87;
}

.totals-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
    padding: 12px;
    background: #f0f4f8;
    border-radius: 4px;
}

.total-box {
    text-align: center;
}

.total-box p {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.total-box .value {
    font-size: 16px;
    font-weight: bold;
    color: #004b87;
}

.footer-preview {
    margin-top: 20px;
    border-top: 2px solid #004b87;
    padding-top: 12px;
    font-size: 10px;
    color: #666;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.footer-item {
    flex: 1;
}

.footer-item .label {
    font-weight: 600;
    color: #004b87;
    margin-bottom: 3px;
}

.footer-item p {
    margin-bottom: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .guias-form-container {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .preview-section {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .guias-form-container {
        padding: 10px;
    }

    .form-section,
    .preview-section {
        padding: 15px;
    }

    .form-header h1 {
        font-size: 18px;
    }

    .preview-pdf {
        padding: 15px;
    }

    .preview-pdf .header {
        flex-direction: column;
        gap: 10px;
    }

    .footer-preview {
        flex-direction: column;
        gap: 10px;
    }
}

/* MODAL DE SUCESSO */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header-sucesso {
    background: linear-gradient(135deg, #004b87 0%, #0066b3 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.modal-header-sucesso h2 {
    margin: 0;
    font-size: 24px;
}

.modal-body-sucesso {
    padding: 30px;
    text-align: center;
}

.numero-destaque {
    margin-bottom: 20px;
    padding: 20px;
    background: #f0f4f8;
    border-radius: 8px;
}

.numero-destaque p {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.numero-grande {
    font-size: 48px;
    font-weight: bold;
    color: #004b87;
    letter-spacing: 2px;
}

.texto-sucesso {
    font-size: 16px;
    color: #333;
    margin: 15px 0 10px 0;
}

.texto-email {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.info-box-sucesso {
    background: #e8f1f7;
    border-left: 4px solid #004b87;
    padding: 15px;
    border-radius: 4px;
    text-align: left;
    margin-bottom: 20px;
}

.info-box-sucesso p {
    margin: 8px 0;
    font-size: 13px;
    color: #333;
}

.info-box-sucesso strong {
    color: #004b87;
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding: 0 30px 30px 30px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-actions .btn-primary {
    background: #004b87;
    color: white;
}

.modal-actions .btn-primary:hover {
    background: #003d6b;
    box-shadow: 0 4px 12px rgba(0, 75, 135, 0.3);
}

.modal-actions .btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.modal-actions .btn-secondary:hover {
    background: #e0e0e0;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .guias-form-container {
        display: block;
        max-width: 100%;
        padding: 0;
        gap: 0;
    }

    .form-section {
        display: none;
    }

    .preview-section {
        box-shadow: none;
        padding: 0;
        max-height: none;
    }

    .preview-pdf {
        border: none;
        padding: 0;
    }

    .modal-overlay {
        display: none;
    }
}

/* Modal de Sucesso */
.sucesso-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sucesso-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease-out;
}

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

.sucesso-header {
    background: linear-gradient(135deg, #004b87 0%, #003d6b 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.sucesso-header h2 {
    margin: 0;
    font-size: 24px;
}

.sucesso-body {
    padding: 30px;
    text-align: center;
}

.numero-grande {
    font-size: 32px;
    font-weight: bold;
    color: #004b87;
    margin: 20px 0;
}

.numero-grande strong {
    color: #004b87;
}

.mensagem {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.sucesso-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.btn-imprimir,
.btn-nova {
    padding: 14px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-imprimir {
    background: #004b87;
    color: white;
}

.btn-imprimir:hover {
    background: #003d6b;
    box-shadow: 0 4px 12px rgba(0, 75, 135, 0.3);
}

.btn-nova {
    background: #f0f0f0;
    color: #666;
}

.btn-nova:hover {
    background: #e0e0e0;
}

@media print {
    .sucesso-overlay,
    .sucesso-modal {
        display: none;
    }
}
