/* ===== Reset e Configurações Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

/* ===== Container Principal ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 100px;
}

/* ===== Cabeçalho ===== */
header {
    /* background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%); */
    background: #000000 ;
    color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.header-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

/* ===== Conteúdo Principal ===== */
main {
    padding: 30px 40px;
}

/* ===== Abas de Navegação ===== */
/* ===== Accordions ===== */
.accordion {
    margin-bottom: 20px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease, opacity 0.3s ease;
}

.accordion:hover {
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.1);
}

.accordion-header {
    background: #ecf0f1;
    padding: 18px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: #e0e6ed;
}

.accordion-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.accordion-icon {
    font-size: 14px;
    color: #7f8c8d;
    transition: transform 0.3s ease;
}

.accordion.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: #ffffff;
}

.accordion.active .accordion-content {
    max-height: 5000px;
    padding: 24px;
}

/* ===== Formulários ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Campo obrigatório */
input[required],
textarea[required],
select[required] {
    border-left: 3px solid #e74c3c;
}

input[required]:valid {
    border-left: 3px solid #27ae60;
}

/* Campo IP com restrição */
select.ip-restricted {
    border-left: 3px solid #f39c12;
    background-color: #fffbea;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #7f8c8d;
}

/* ===== Form Row (campos lado a lado) ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

/* ===== Campo com Unidade de Medida ===== */
.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    width: 100%;
    padding-right: 55px;
}

.unit-label {
    position: absolute;
    right: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #7f8c8d;
    pointer-events: none;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Campo desabilitado com visual diferenciado */
input.field-disabled,
input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    color: #6c757d;
}

/* Tooltip de informação */
.info-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 6px;
    line-height: 18px;
    position: relative;
    transition: all 0.3s ease;
}

.info-tooltip:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.info-tooltip::before {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.info-tooltip::after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.info-tooltip:hover::before,
.info-tooltip:hover::after {
    opacity: 1;
}

/* Informação de cálculo de potência */
.potencia-calc-info {
    display: block;
    font-style: italic;
    color: #27ae60 !important;
    font-weight: 500;
}

/* ===== Checkboxes e Radios ===== */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-group label,
.radio-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* ===== Seções de Filtro ===== */
.filter-section {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.form-subgroup {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-subgroup label:first-child {
    font-weight: 500;
    min-width: 80px;
}

/* ===== Grid de Posições ===== */
.position-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
}

.position-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.position-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-width: 200px;
}

.position-center img {
    border: 2px solid #e0e6ed;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.position-item {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.position-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #2c3e50;
}

.position-item label {
    display: block;
    font-weight: 400;
    font-size: 13px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    padding: 4px 6px;
    border-radius: 4px;
}

.position-item label:hover {
    background: #e9ecef;
}

.position-item input[type="checkbox"]:checked + label,
.position-item label:has(input[type="checkbox"]:checked) {
    background: #d4edda;
    border-left: 3px solid #28a745;
    font-weight: 500;
}

/* Destaque para checkboxes de posição */
.pos-exclusive:checked {
    accent-color: #28a745;
}

/* Responsividade para layout de posições */
@media (max-width: 900px) {
    .position-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .position-center {
        order: 0;
        margin-bottom: 16px;
    }
    
    .position-column:first-child {
        order: 1;
    }
    
    .position-column:last-child {
        order: 2;
    }
}

/* ===== Info Box ===== */
.info-box {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.info-box p {
    margin: 0;
    font-size: 14px;
    color: #2c3e50;
}

/* ===== Tooltip de Informação ===== */
.info-tooltip {
    cursor: help;
    margin-left: 5px;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-tooltip:hover {
    opacity: 1;
}

/* ===== Circuitos Dinâmicos ===== */
.circuito-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.circuito-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.circuito-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
}

.circuito-item .form-row {
    gap: 16px;
}

.circuito-item .form-group {
    margin-bottom: 0;
}

.circuito-item .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
}

/* ===== Rodapé com Botões Fixos ===== */
.footer-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 16px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 1000;
}

/* ===== Botões ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #ffffff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* ===== Upload de Arquivos ===== */
input[type="file"] {
    padding: 8px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

input[type="file"]::-webkit-file-upload-button {
    padding: 6px 12px;
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 13px;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: #d5dbdb;
}

/* ===== Botão Adicionar Arquivo ===== */
.btn-add-file {
    padding: 10px 20px;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
    margin-bottom: 10px;
}

.btn-add-file:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.4);
    transform: translateY(-1px);
}

.btn-add-file:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

/* ===== Lista de Arquivos ===== */
.file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #ecf0f1;
    border-color: #bdc3c7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.file-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-item-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    word-break: break-word;
}

.file-item-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #7f8c8d;
}

.file-item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-item-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.btn-file-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-view {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.btn-view:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    box-shadow: 0 3px 6px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.btn-remove {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.btn-remove:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    box-shadow: 0 3px 6px rgba(231, 76, 60, 0.4);
    transform: translateY(-1px);
}

.file-list-empty {
    padding: 15px;
    text-align: center;
    color: #95a5a6;
    font-size: 13px;
    font-style: italic;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 6px;
    margin-top: 10px;
}

/* ===== Botão Visualizar Arquivo (REMOVER - não usado mais) ===== */
.btn-view-file {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.btn-view-file:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.btn-view-file:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

/* ===== Responsividade ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 8px;
        margin-bottom: 80px;
    }

    header {
        padding: 20px 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .header-logo {
        height: 50px;
    }

    .header-text {
        text-align: center;
    }

    header h1 {
        font-size: 22px;
    }

    main {
        padding: 20px;
    }
    
    .tabs-container {
        padding: 0 20px;
        flex-wrap: wrap;
    }
    
    .tab-button {
        padding: 12px 20px;
        font-size: 14px;
        flex: 1;
        min-width: 140px;
    }

    .accordion.active .accordion-content {
        padding: 16px;
    }

    .accordion-header {
        padding: 14px 16px;
    }

    .accordion-header h2 {
        font-size: 16px;
    }

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

    .position-grid {
        grid-template-columns: 1fr;
    }

    .footer-buttons {
        padding: 12px 10px;
        gap: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .checkbox-group,
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .header-logo {
        height: 40px;
    }

    header h1 {
        font-size: 18px;
    }

    header p {
        font-size: 12px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 auto;
    }

    .footer-buttons {
        gap: 6px;
    }
}

/* ===== Animações ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accordion {
    animation: fadeIn 0.3s ease;
}

/* ===== Campo "Outros" com animação ===== */
textarea[id$="Outros"],
textarea[id$="Outro"],
textarea[id$="Outra"] {
    animation: fadeIn 0.3s ease;
    background-color: #fffbea;
    border-left: 3px solid #f39c12;
}

textarea[id$="Outros"]::placeholder,
textarea[id$="Outro"]::placeholder,
textarea[id$="Outra"]::placeholder {
    color: #7f8c8d;
    font-style: italic;
}

/* ===== Melhorias de Acessibilidade ===== */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ===== Estados de Loading (pode ser usado futuramente) ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== Mensagens de Status ===== */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-message.success {
    background: #2ecc71;
    color: #ffffff;
}

.status-message.error {
    background: #e74c3c;
    color: #ffffff;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Periféricos por Circuito ===== */
.periferico-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.periferico-box h5 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.periferico-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.periferico-section h6 {
    color: #34495e;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.periferico-section .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.periferico-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* ===== Acumuladores Dinâmicos ===== */
.acumulador-item {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.acumulador-item h6 {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-remover-acumulador {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-remover-acumulador:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #2980b9;
}

