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

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-wrapper .container {
    flex: 1;
}

/* Header */
.header {
    background: #1a3a5c;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-sair {
    margin-left: auto;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-sair:hover {
    background: rgba(255,255,255,0.25);
}

.badge {
    background: #e8a500;
    color: #1a3a5c;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1a3a5c;
}

.subtitle {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Select Unidade */
.select-unidade {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select-unidade:focus {
    outline: none;
    border-color: #1a3a5c;
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #444;
}

.required {
    color: #dc3545;
}

.input-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

#input-cpf {
    flex: 1;
    max-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

#input-cpf:focus {
    outline: none;
    border-color: #1a3a5c;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #1a3a5c;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #254d75;
}

.btn-success {
    background: #28a745;
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    margin-top: 1.5rem;
    width: 100%;
    justify-content: center;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

/* Resultado Consulta */
.resultado-sucesso {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.resultado-sucesso .icon-check {
    color: #28a745;
    font-weight: bold;
    margin-right: 0.5rem;
}

.resultado-erro {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.resultado-erro .icon-x {
    color: #dc3545;
    font-weight: bold;
    margin-right: 0.5rem;
}

.resultado-alerta {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.resultado-alerta .icon-warn {
    margin-right: 0.5rem;
}

.resultado-info p {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.resultado-info strong {
    color: #1a3a5c;
}

/* Grid de Oficinas */
.oficinas-grid {
    display: grid;
    gap: 1rem;
}

.oficina-grupo {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #fafafa;
}

.oficina-grupo h3 {
    font-size: 1rem;
    color: #1a3a5c;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8a500;
}

.oficina-opcoes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.oficina-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.oficina-item:hover:not(.disabled) {
    border-color: #1a3a5c;
    background: #f0f5ff;
}

.oficina-item.selected {
    border-color: #28a745;
    background: #d4edda;
}

.oficina-item.checkin-realizado {
    border-color: #1a3a5c;
    background: #cce5ff;
    opacity: 1;
    cursor: default;
    box-shadow: 0 0 0 2px #1a3a5c;
}

.oficina-item.checkin-realizado .nome-sala {
    color: #1a3a5c;
    font-weight: 700;
}

.oficina-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.oficina-item input[type="radio"] {
    accent-color: #28a745;
    width: 18px;
    height: 18px;
}

.oficina-item .info {
    flex: 1;
}

.oficina-item .nome-sala {
    font-weight: 500;
    font-size: 0.9rem;
}

.oficina-item .horario {
    font-size: 0.8rem;
    color: #666;
}

.oficina-item .vagas {
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

.vagas-ok {
    background: #d4edda;
    color: #155724;
}

.vagas-baixa {
    background: #fff3cd;
    color: #856404;
}

.vagas-zero {
    background: #f8d7da;
    color: #721c24;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

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

.sucesso-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.modal-content h2 {
    color: #28a745;
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Utilitários */
.hidden {
    display: none !important;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a3a5c;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    width: 340px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.login-box h2 {
    color: #1a3a5c;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-form input {
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #1a3a5c;
}

.login-erro {
    color: #dc3545;
    font-size: 0.85rem;
    margin: 0;
}

/* Footer */
.footer {
    background: #1a3a5c;
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsivo */
@media (max-width: 768px) {
    .header-content {
        padding: 0 0.5rem;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .container {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }

    .card {
        padding: 1rem 1rem;
    }

    .input-group {
        flex-direction: column;
    }

    #input-cpf {
        max-width: 100%;
    }

    .oficina-opcoes {
        grid-template-columns: 1fr;
    }

    .oficina-item {
        padding: 0.75rem;
    }

    .btn-success {
        font-size: 1rem;
        padding: 0.85rem 1.5rem;
    }

    .login-box {
        width: 90%;
        padding: 2rem 1.5rem;
    }

    .select-unidade {
        max-width: 100%;
    }
}

/* Toast */
.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #28a745;
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 3000;
    pointer-events: none;
    max-width: 600px;
    min-width: 400px;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Campos extras (nome/email para LP e novo cadastro) */
.campo-extra {
    margin-top: 0.75rem;
}

.campo-extra label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
}

.input-extra {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-extra:focus {
    outline: none;
    border-color: #1a3a5c;
}

/* Check-in já realizado - azul claro */
.resultado-checkin-existente {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.resultado-checkin-existente .icon-warn {
    margin-right: 0.5rem;
}

/* Novo cadastro - vermelho claro */
.resultado-novo-cadastro {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.resultado-novo-cadastro .icon-warn {
    margin-right: 0.5rem;
}
