/* =========================================================
   CONVERSOR DE COMPRIMENTO
   Estilos exclusivos da ferramenta
   ========================================================= */

.length-tool {
    max-width: 960px;
    margin: 0 auto;
}


/* =========================================================
   DESCRIÇÃO
   ========================================================= */

.length-description {
    margin: 0 0 25px;
    color: #64748b;
    line-height: 1.6;
}


/* =========================================================
   ÁREA DO VALOR
   ========================================================= */

.length-value-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
}

.length-value-area label {
    width: min(100%, 400px);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: .9rem;
    color: #1e293b;
}

.length-value-area input {
    width: min(100%, 400px);
    height: 52px;
    box-sizing: border-box;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font: inherit;
    font-size: 1.15rem;
    text-align: center;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.length-value-area input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}


/* =========================================================
   DE / TROCA / PARA
   ========================================================= */

.length-conversion-row {
    display: grid;
    grid-template-columns: 1fr 62px 1fr;
    gap: 14px;
    align-items: end;
    max-width: 820px;
    margin: 0 auto;
}

.length-unit-field {
    display: flex;
    flex-direction: column;
}

.length-unit-field label {
    margin-bottom: 8px;
    font-size: .9rem;
    font-weight: 600;
    color: #1e293b;
}

.length-unit-field select {
    width: 100%;
    min-height: 46px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font: inherit;
    cursor: pointer;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.length-unit-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}


/* =========================================================
   TROCA DE UNIDADES
   ========================================================= */

.length-swap-area {
    display: flex;
    justify-content: center;
}

.length-swap-button {
    width: 56px;
    height: 46px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.length-swap-button:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.length-swap-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .18);
    outline-offset: 2px;
}


/* =========================================================
   BOTÕES
   ========================================================= */

.length-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.length-button {
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .15s ease;
}

.length-button:hover {
    transform: translateY(-1px);
}

.length-button:active {
    transform: translateY(0);
}

.length-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .18);
    outline-offset: 2px;
}

.length-button-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.length-button-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.length-button-secondary {
    background: #fff;
    border-color: #e2e8f0;
    color: #1e293b;
}

.length-button-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}


/* =========================================================
   RESULTADO
   ========================================================= */

.length-result {
    display: none;
    margin-top: 30px;
}

.length-result.visible {
    display: block;
}

.length-result-box {
    padding: 28px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    text-align: center;
}

.length-result-title {
    margin-bottom: 10px;
    color: #64748b;
    font-size: .9rem;
    font-weight: 600;
}

.length-result-value {
    color: #0f172a;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.length-equation {
    margin-top: 12px;
    color: #64748b;
    line-height: 1.5;
}

.length-copy-status {
    min-height: 20px;
    margin-top: 10px;
    color: #2563eb;
    font-size: .8rem;
}

.length-result-box .length-actions {
    margin-top: 18px;
}


/* =========================================================
   EQUIVALÊNCIAS
   ========================================================= */

.length-equivalences {
    margin-top: 24px;
}

.length-equivalences h3 {
    margin: 0 0 15px;
    color: #0f172a;
    font-size: 1.05rem;
}

.length-equivalence-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.length-equivalence-item {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.length-equivalence-item:hover {
    border-color: #bfdbfe;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
}

.length-equivalence-name {
    margin-bottom: 6px;
    color: #64748b;
    font-size: .8rem;
    line-height: 1.4;
}

.length-equivalence-value {
    color: #1e293b;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
}


/* =========================================================
   AVISO
   ========================================================= */

.length-tip {
    margin-top: 22px;
    padding: 15px 17px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: .84rem;
    line-height: 1.6;
}

.length-tip strong {
    color: #1e293b;
}


/* =========================================================
   CONTEÚDO INFORMATIVO
   ========================================================= */

.length-info {
    max-width: 960px;
    margin: 0 auto;
}

.length-info-card {
    padding: 28px;
}

.length-info-card h2 {
    margin-top: 0;
}

.length-info-card h3 {
    margin-top: 25px;
}

.length-info-card p {
    color: #475569;
    line-height: 1.65;
}


/* =========================================================
   RESPONSIVIDADE
   ========================================================= */

@media (max-width: 700px) {

    .length-conversion-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .length-swap-area {
        align-items: center;
    }

    .length-swap-button {
        width: 100%;
    }

    .length-equivalence-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 480px) {

    .length-value-area input {
        width: 100%;
    }

    .length-value-area label {
        width: 100%;
    }

    .length-equivalence-grid {
        grid-template-columns: 1fr;
    }

    .length-actions {
        flex-direction: column;
    }

    .length-button {
        width: 100%;
    }

    .length-result-box {
        padding: 22px 18px;
    }

    .length-result-value {
        font-size: 2rem;
    }

}


/* =========================================================
   IMPRESSÃO
   ========================================================= */

@media print {

    header,
    footer,
    .tool-breadcrumb,
    .tool-header,
    .ad-container,
    .length-actions,
    .length-tip {
        display: none !important;
    }

    .length-result {
        display: block !important;
    }

    .length-result-box {
        border: 1px solid #ccc;
        background: #fff;
    }

    .length-equivalence-item {
        border: 1px solid #ccc;
    }

}