@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', sans-serif;
        }

        .div-header-icones {
            display: flex;
            align-items: center;
        }

        body {
            background: linear-gradient(180deg, #000 0%, #3a2415 40%, #d87c2b 100%);
            color: #222;
            display: flex;
            flex-direction: column;
            height: 100vh;
        }

        header {
            background-color: #262626;
            width: 100%;
            display: flex;
            justify-content: space-between;
        }

        main.container_metrologia {
            flex: 1;
            width: 100%;
            overflow-y: auto;
        }

        .titulo_metrologia {
            font-size: 1.6rem;
            font-weight: 600;
            margin-top: 1rem;
            color: #fff;
            margin-bottom: 1rem;
            text-align: center;
            text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
        }

        .secao_metrologia {
            background-color: #262626;
            border-radius: 14px;
            padding: 1rem;
            margin: 1rem;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            width: 90%;
            margin: auto;
            display: flex;
            flex-direction: column;
            margin-top: 2rem;
        }

        .secao_metrologia h3 {
            font-size: 1.15rem;
            font-weight: 600;
            color: #f35f15;
            margin-bottom: 0.8rem;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .campo label {
            display: block;
            font-weight: 600;
            color: #ffffff;
            margin-bottom: 0.4rem;
        }

        .campo input,
        .campo textarea {
            width: 100%;
            padding: 0.8rem;
            font-size: 0.95rem;
            border: 1px solid #ccc;
            border-radius: 8px;
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .campo input:focus,
        .campo textarea:focus {
            border-color: #f35f15;
            box-shadow: 0 0 0 2px rgba(243, 95, 21, 0.25);
        }

        textarea {
            resize: none;
            min-height: 80px;
        }

        .botao-avancar {
            width: 100%;
            background: linear-gradient(90deg, #f35f15, #ff7b00);
            color: #ffffff;
            border: none;
            padding: 0.7rem;
            border-radius: 10px;
            font-weight: 500;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: 1rem;
        }

        .botao-voltar {
            width: 100%;
            background: linear-gradient(135deg, #858181, #555454);
            color: #ffffff;
            border: none;
            padding: 0.7rem;
            border-radius: 10px;
            font-weight: 500;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: 1rem;
        }

        .modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.75);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .modal-conteudo {
            background: #fff;
            border-radius: 12px;
            width: 90%;
            max-width: 400px;
            padding: 1.5rem;
            text-align: center;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.3s ease;
        }

        .modal h3 {
            color: #f35f15;
            margin-bottom: 1rem;
            font-size: 1.2rem;
        }

        .modal button {
            width: 100%;
            margin-top: 0.5rem;
            padding: 0.8rem;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
        }

        .btn-sim {
            background: linear-gradient(90deg, #f35f15, #ff7b00);
            color: white;
        }

        .btn-nao {
            background: #ddd;
            color: #333;
        }

        .secao_medidas {
            display: block;
            padding: 1rem;
            margin: 1rem;
            background: #262626;
            border-radius: 14px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            animation: fadeIn 0.3s ease;
            color: white;
        }

        .card_peca {
            border-radius: 12px;
            margin-bottom: 0;
            /* será calculado automaticamente */
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }

        .card_peca img {
            width: 100%;
            display: block;
            position: relative;
            z-index: 12;
        }

        .card_conteudo {
            padding: 1rem;
            display: none;
            background-color: white;
            color: black;
            width: 100%;
            margin-top: 1rem;
            z-index: 10;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }

        .card_conteudo.ativo {
            display: block;
        }


        .card_conteudo input {
            color: #000000;
            padding: 0.2rem 0.5rem;
            outline: none;
            transition: 0.2s;
            height: 40px;
            border: 1px solid #ccc;
            border-radius: 6px;
            font-size: 0.95rem;
            width: 100%;
        }

        /* ===== ETAPA DE FOTOS ===== */
        .secao_fotos {
            display: none;
            padding: 1.4rem;
            margin: 1rem;
            background: #262626;
            color: white;
            border-radius: 14px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            text-align: center;
        }

        .preview-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 1rem;
            margin-top: 1rem;
        }

        .preview {
            position: relative;
            width: 140px;
            height: 140px;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }

        .preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .btn-excluir {
            position: absolute;
            top: 5px;
            right: 5px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            border: none;
            border-radius: 50%;
            width: 28px;
            height: 28px;
            cursor: pointer;
        }

        .btn-foto {
            display: block;
            background: linear-gradient(90deg, #f35f15, #ff7b00);
            color: white;
            padding: 0.6rem 0.8rem;
            border-radius: 10px;
            font-weight: 600;
            margin: 0 auto;
            border: none;
            cursor: pointer;
            font-size: 18px;
        }

        .container_etapa {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .container_pecas {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .container_campos_metrologia {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .input-grupo {
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .select-unidade {
            color: #000000;
            padding: 0.2rem 0.5rem;
            outline: none;
            transition: 0.2s;
            height: 40px;
            border: 1px solid #ccc;
            border-radius: 6px;
            font-size: 0.95rem;
        }

        .container_inputs_medidas {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .preview-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            justify-items: center;
            margin-top: 1rem;
        }

        .preview-slot {
            aspect-ratio: 1 / 1;
            width: 100%;
            border-radius: 10px;
            background: #dcdcdc;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
        }

        .preview-slot img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .preview-slot .btn-excluir {
            position: absolute;
            top: 5px;
            right: 5px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            border: none;
            border-radius: 50%;
            width: 28px;
            height: 28px;
            cursor: pointer;
        }

        .div_tipo_medida {
            display: flex;
            flex-direction: column;
        }

        .div_medidas_relatorio {
            background: #f8f8f8;
            border-radius: 8px;
            padding: 0.7rem;
            margin-top: 0.3rem;
            color: #222;
            font-size: 1rem;
            line-height: 1.5;
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
        }

        .titulo_parte_peca{
            font-size: 18px;
            font-weight: 500;
        }

        .medida_retifica{
            color: #007bff;
            font-weight: 600;
        }

        .diferenca_retifica{
            color: #ff8f00;
            font-weight: 600;
        }

        .div_antes_depois{
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
        }