body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    color: #000;
    font-size: 11px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 10px;
    border: 1px solid #003366;
}

.main-header {
    text-align: center;
    margin-bottom: 10px;
    color: #003366;
    border-bottom: 2px solid #003366;
    padding-bottom: 10px;
}

.main-header h1 {
    font-size: 16px;
    margin: 0;
    font-weight: bold;
}

.panel {
    border: 1px solid #86A3C2;
    margin-bottom: 10px;
    background-color: #fff;
}

.panel-header {
    background: #D0E5F5 url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iZyIgeDE9IjAlIiB4Mj0iMCUiIHkxPSIwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNlMGVmZjkiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNkMGU1ZjUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2cpIi8+PC9zdmc+'); /* Fallback SVG gradient */
    background: -webkit-linear-gradient(top, #e0eff9 0%, #d0e5f5 100%);
    background: linear-gradient(to bottom, #e0eff9 0%, #d0e5f5 100%);
    padding: 4px 10px;
    border-bottom: 1px solid #86A3C2;
}

.panel-header h2 {
    margin: 0;
    font-size: 11px;
    color: #003366;
    font-weight: bold;
    text-transform: none;
}

.panel-body {
    padding: 10px;
    background-color: #F4F9FD;
}

.instructions {
    font-size: 11px;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 5px;
    margin: 5px;
}

.form-group {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 11px;
    color: #003366;
}

input[type="text"], textarea, select {
    width: 100%;
    padding: 3px;
    border: 1px solid #7F9DB9;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    background-color: #fff;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.counter {
    text-align: right;
    font-size: 10px;
    color: #003366;
    margin-top: 1px;
}

.actions-bar {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
}

.btn-primary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    background-color: #003366;
    color: white;
    border: 1px solid #002244;
    padding: 5px 15px;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
    font-family: Verdana, Arial, sans-serif;
}

.btn-primary:hover {
    background-color: #004488;
}

.field-feedback {
    margin-top: 4px;
    font-size: 12px;
    font-family: Verdana, Arial, sans-serif;
}

.field-feedback.error {
    color: red;
}

/* PDF Specific Styles - Applied to the clone */
.pdf-text-element {
    border: 1px solid #ccc;
    padding: 5px;
    background-color: #fff;
    min-height: 20px;
    white-space: pre-wrap;
    font-size: 11px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: #000;
    margin-top: 2px;
}

.btn-secondary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    background-color: #e9ecef;
    color: #212529;
    border: 1px solid #ced4da;
    padding: 5px 15px;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
    font-family: Verdana, Arial, sans-serif;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.pdf-header-info {
    font-weight: bold;
    color: #003366;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

/* ===== RESPONSIVIDADE MOBILE ===== */

/* Tablets e dispositivos médios */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 12px;
    }

    .container {
        padding: 8px;
    }

    .main-header h1 {
        font-size: 14px;
    }

    .main-header div {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .main-header img {
        max-height: 60px !important;
    }

    label {
        font-size: 12px;
    }

    input[type="text"], textarea, select {
        font-size: 14px;
        padding: 6px;
    }

    textarea {
        min-height: 120px;
    }

    .btn-primary, .btn-secondary {
        font-size: 14px;
        padding: 8px 20px;
        width: 100%;
        margin-bottom: 8px;
    }

    .actions-bar {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
}

/* Smartphones */
@media screen and (max-width: 480px) {
    body {
        padding: 5px;
        font-size: 13px;
    }

    .container {
        padding: 5px;
        border: none;
    }

    .main-header {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .main-header h1 {
        font-size: 13px;
    }

    .main-header img {
        max-height: 50px !important;
    }

    .panel {
        margin-bottom: 8px;
    }

    .panel-header {
        padding: 6px 8px;
    }

    .panel-header h2 {
        font-size: 12px;
    }

    .panel-body {
        padding: 8px;
    }

    .instructions {
        padding: 8px;
        margin: 3px;
    }

    .instructions ol {
        padding-left: 18px !important;
    }

    .form-group {
        margin-bottom: 10px;
    }

    label {
        font-size: 13px;
        margin-bottom: 4px;
    }

    input[type="text"], textarea, select {
        font-size: 16px; /* Evita zoom automático no iOS */
        padding: 8px;
    }

    textarea {
        min-height: 100px;
    }

    .counter {
        font-size: 11px;
    }

    .btn-primary, .btn-secondary {
        font-size: 15px;
        padding: 10px 20px;
        width: 100%;
        margin-bottom: 10px;
        touch-action: manipulation; /* Melhora resposta ao toque */
    }

    .actions-bar {
        margin-top: 15px;
        padding: 8px 0;
    }

    /* Melhorias para elementos de consulta */
    #verify-url {
        font-size: 10px;
        word-break: break-all;
    }

    /* Ajuste para div com botões lado a lado */
    div[style*="display:flex"] {
        flex-direction: column !important;
    }

    /* Melhor visualização de resultados */
    #result-content {
        font-size: 13px;
    }

    .field-feedback {
        font-size: 13px;
    }
}

/* Smartphones muito pequenos */
@media screen and (max-width: 360px) {
    body {
        font-size: 12px;
    }

    .main-header h1 {
        font-size: 12px;
    }

    .main-header img {
        max-height: 40px !important;
    }

    input[type="text"], textarea, select {
        font-size: 16px;
        padding: 6px;
    }

    .btn-primary, .btn-secondary {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Melhorias para landscape em celulares */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .main-header img {
        max-height: 40px !important;
    }

    .panel {
        margin-bottom: 5px;
    }

    textarea {
        min-height: 80px;
    }
}

/* Melhorias para acessibilidade touch */
@media (hover: none) and (pointer: coarse) {
    input[type="text"],
    textarea,
    select,
    button,
    .btn-primary,
    .btn-secondary {
        min-height: 44px; /* Tamanho mínimo recomendado para toque */
    }

    input[type="text"],
    textarea,
    select {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 4px;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loading {
    opacity: 0.7;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Success Message Highlight */
.success-highlight {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    border: 1px solid transparent;
    text-align: center;
    font-size: 14px;
}

.success-highlight strong {
    font-size: 16px;
    display: block;
    margin-bottom: 10px;
}
