/* ═══════════════════════════════════════════════════
   DELTA PMA – Dimensionador de Robôs
   B2B Corporate Theme  •  #003366 / #cc0000
   VERSÃO OTIMIZADA - 2026-05-13
   ═══════════════════════════════════════════════════ */

/* ── Reset & Base ── */
#delta-pma-wrapper {
    max-width: 720px;
    margin: 2.5rem auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
    padding: 0 12px;
}
#delta-pma-wrapper *,
#delta-pma-wrapper *::before,
#delta-pma-wrapper *::after {
    box-sizing: border-box;
}

/* ── Header ── */
.dpma-header {
    text-align: center;
    margin-bottom: 0;
    padding: 2rem 2rem;
    background: #003366;
    border-radius: 12px 12px 0 0;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,51,102,0.2);
}
.dpma-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
    letter-spacing: -0.02em;
}
.dpma-subtitle {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.85;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ── Form Container ── */
#delta-pma-form {
    background: #fff;
    padding: 2.2rem 2rem;
    border: 1px solid #e2e8f0;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0,51,102,0.08);
}

/* ── Field rows ── */
.dpma-field-row {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 0;
}
.dpma-field {
    flex: 1;
    margin-bottom: 1.5rem;
}
.dpma-field-full {
    width: 100%;
}
.dpma-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Input wrappers ── */
.dpma-input-wrap {
    position: relative;
    display: block;
}
.dpma-input-icon {
    position: absolute;
    left: 12px;
    font-size: 1.1rem;
    color: #8896a6;
    pointer-events: none;
    z-index: 1;
}
.dpma-unit {
    position: absolute;
    right: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8896a6;
    pointer-events: none;
}
.dpma-input-wrap input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.9rem;
    font-size: 0.95rem;
    border: 1.5px solid #d0d7de;
    border-radius: 8px;
    background: #f8fafc;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    color: #1a1a2e;
    font-family: inherit;
}
.dpma-input-wrap input::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}
.dpma-input-wrap input:focus {
    outline: none;
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0,51,102,0.12);
    background: #fff;
}
.dpma-input-wrap textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-size: 0.95rem;
    border: 1.5px solid #d0d7de;
    border-radius: 8px;
    background: #f8fafc;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    color: #1a1a2e;
    font-family: inherit;
    display: block;
}
.dpma-input-wrap textarea::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}
.dpma-input-wrap textarea:focus {
    outline: none;
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0,51,102,0.12);
    background: #fff;
}
.dpma-input-wrap p {
    display: block;
    width: 100%;
    margin-top: 8px;
}

/* ── Selects ── */
.dpma-select-wrap {
    position: relative;
}
.dpma-select-wrap select {
    width: 100%;
    padding: 0.75rem 2.2rem 0.75rem 0.9rem;
    font-size: 0.95rem;
    border: 1.5px solid #d0d7de;
    border-radius: 8px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    color: #1a1a2e;
    font-family: inherit;
    font-weight: 500;
}
.dpma-select-wrap select:hover {
    border-color: #adb8c4;
}
.dpma-select-wrap select:focus {
    outline: none;
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0,51,102,0.12);
    background-color: #fff;
}

/* ── Submit Button ── */
#dpma-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: #003366;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    margin-top: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.95rem;
}
#dpma-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,51,102,0.4);
    background: #002244;
}
#dpma-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,51,102,0.3);
}
#dpma-submit:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* ── Footer ── */
.dpma-footer {
    text-align: center;
    padding: 1.2rem 2rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    font-size: 0.78rem;
    color: #64748b;
}
.dpma-footer p {
    margin: 0;
}

/* ═══════════════════════════════════════════
   RESULT CARD
   ═══════════════════════════════════════════ */

@keyframes dpmaFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.dpma-fade-in {
    animation: dpmaFadeIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dpma-result-card {
    margin-top: 2.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,51,102,0.12);
}

.dpma-result-badge {
    background: linear-gradient(135deg, #003366, #004080);
    color: #fff;
    text-align: center;
    padding: 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dpma-result-body {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}
.dpma-result-img {
    flex: 0 0 140px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.dpma-result-img img {
    width: 140px;
    height: auto;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0,51,102,0.08);
}
.dpma-result-info {
    flex: 1;
    min-width: 0;
}
.dpma-result-model {
    margin: 0 0 0.3rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: #003366;
}
.dpma-result-series {
    display: inline-block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.dpma-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}
.dpma-spec {
    padding: 0.8rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.dpma-spec-highlight {
    background: linear-gradient(135deg, #eef6ff, #dbeafe);
    border-color: #7dd3fc;
    box-shadow: 0 2px 8px rgba(125,211,252,0.15);
}
.dpma-spec-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.dpma-spec-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: #003366;
}
.dpma-spec-note {
    display: block;
    font-size: 0.7rem;
    color: #3b82f6;
    font-weight: 600;
    margin-top: 0.2rem;
}

.dpma-margin-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.8rem;
    padding: 0.8rem;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #dcfce7;
}
.dpma-margin-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
    text-transform: uppercase;
}
.dpma-progress-track {
    flex: 1;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.dpma-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 6px;
    transition: width 1s ease-out;
}
.dpma-margin-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #059669;
    white-space: nowrap;
}

.dpma-result-notes {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: #92400e;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 0.8rem;
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

.dpma-alternatives {
    padding: 1.2rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.dpma-alternatives h4 {
    margin: 0 0 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #003366;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dpma-alt-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.dpma-alt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s, border-color 0.2s;
}
.dpma-alt-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.dpma-alt-item strong {
    color: #003366;
    font-weight: 700;
}
.dpma-alt-item span {
    color: #64748b;
    font-size: 0.78rem;
}

.dpma-result-footer {
    padding: 1.2rem 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    background: linear-gradient(135deg, #003366, #001a33);
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.6;
}
.dpma-result-footer p {
    margin: 0;
}
.dpma-result-footer strong {
    color: #93c5fd;
    font-weight: 700;
}

.dpma-error {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #cc0000;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    #delta-pma-wrapper {
        margin: 1.5rem auto;
    }
    .dpma-header {
        padding: 2rem 1.5rem;
    }
    .dpma-title {
        font-size: 1.5rem;
    }
    #delta-pma-form {
        padding: 1.5rem;
    }
    .dpma-field-row {
        flex-direction: column;
        gap: 0;
    }
    .dpma-field {
        margin-bottom: 1.2rem;
    }
}

@media (max-width: 640px) {
    #delta-pma-wrapper {
        margin: 1rem;
        padding: 0;
    }
    .dpma-header {
        border-radius: 8px 8px 0 0;
        padding: 1.5rem 1.2rem;
    }
    .dpma-header-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    .dpma-title {
        font-size: 1.3rem;
    }
    .dpma-subtitle {
        font-size: 0.9rem;
    }
    #delta-pma-form {
        padding: 1.2rem;
    }
    #dpma-submit {
        padding: 0.75rem 1.2rem;
        font-size: 0.9rem;
    }
    .dpma-result-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .dpma-result-img {
        flex: 0 0 auto;
    }
    .dpma-result-img img {
        width: 120px;
    }
    .dpma-specs-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .dpma-margin-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .dpma-alt-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .dpma-alternatives {
        padding: 1rem 1.2rem;
    }
    .dpma-result-footer {
        padding: 1rem 1.2rem;
    }
}
