.ipp-mat-wrap {
    max-width: 920px;
    margin: 24px auto;
    padding: 0 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1f2937;
    line-height: 1.5;
    box-sizing: border-box;
}
.ipp-mat-wrap *, .ipp-mat-wrap *::before, .ipp-mat-wrap *::after {
    box-sizing: border-box;
}

.ipp-mat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.ipp-mat-card h2, .ipp-mat-card h3 {
    margin: 0 0 14px 0;
    color: #0f2a4a;
    font-weight: 700;
    line-height: 1.3;
}
.ipp-mat-card h3 {
    font-size: 1.2rem;
    border-bottom: 2px solid #eff6ff;
    padding-bottom: 8px;
}
.ipp-mat-card h4 {
    margin: 16px 0 10px 0;
    font-size: 1rem;
    color: #1e3a5f;
}

.ipp-mat-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #0f2a4a;
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.ipp-mat-topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.ipp-mat-topbar-sub {
    font-size: 0.88rem;
    color: #dbeafe;
    margin-top: 2px;
}
.ipp-mat-topbar-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.ipp-mat-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #0f172a;
}
.ipp-mat-badge-borrador { background: #fef3c7; color: #92400e; }
.ipp-mat-badge-enviada { background: #dbeafe; color: #1e40af; }
.ipp-mat-badge-requiere_correccion { background: #fee2e2; color: #991b1b; }
.ipp-mat-badge-revisada { background: #dcfce7; color: #166534; }
.ipp-mat-badge-pay { background: #f1f5f9; color: #334155; }

.ipp-mat-logout {
    color: #ffffff !important;
    text-decoration: underline;
    font-size: 0.85rem;
    margin-left: 6px;
}

.ipp-mat-alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border-left: 4px solid #64748b;
    background: #f8fafc;
    font-size: 0.94rem;
}
.ipp-mat-alert-success { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.ipp-mat-alert-error { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.ipp-mat-alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.ipp-mat-alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }
.ipp-mat-list {
    margin: 8px 0 0 18px;
    padding: 0;
}

.ipp-mat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}
.ipp-mat-tab {
    flex: 1 1 auto;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
}
.ipp-mat-tab.is-active {
    background: #0f2a4a;
    color: #ffffff;
    border-color: #0f2a4a;
}
.ipp-mat-tab-panel { display: none; }
.ipp-mat-tab-panel.is-active { display: block; }

.ipp-mat-grid-2, .ipp-mat-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 720px) {
    .ipp-mat-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .ipp-mat-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.ipp-mat-field {
    margin-bottom: 12px;
}
.ipp-mat-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #1e293b;
}
.ipp-mat-field input[type="text"],
.ipp-mat-field input[type="email"],
.ipp-mat-field input[type="tel"],
.ipp-mat-field input[type="date"],
.ipp-mat-field input[type="password"],
.ipp-mat-field select,
.ipp-mat-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    background: #ffffff;
    color: #0f172a;
}
.ipp-mat-field input:focus,
.ipp-mat-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.ipp-mat-field small, .ipp-mat-muted {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    margin-top: 4px;
}
.ipp-mat-check-inline label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.ipp-mat-radio-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 640px) {
    .ipp-mat-radio-group { grid-template-columns: 1fr 1fr; }
}
.ipp-mat-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.92rem;
}
.ipp-mat-radio-card input[type="radio"] {
    margin-top: 3px;
    transform: scale(1.2);
}
.ipp-mat-sostenedor-box {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #cbd5e1;
}

.ipp-mat-docs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 720px) {
    .ipp-mat-docs-grid { grid-template-columns: repeat(2, 1fr); }
}
.ipp-mat-doc-item {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
}
.ipp-mat-doc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.ipp-mat-doc-head label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}
.ipp-mat-req-tag {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}
.ipp-mat-req-tag.is-req { background: #fee2e2; color: #991b1b; }
.ipp-mat-req-tag.is-opt { background: #e2e8f0; color: #334155; }

.ipp-mat-doc-existing {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.82rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}
.ipp-mat-doc-existing a {
    color: #047857;
    font-weight: 700;
    text-decoration: underline;
}
.ipp-mat-doc-item input[type="file"] {
    width: 100%;
    font-size: 0.88rem;
}

.ipp-mat-autosave {
    position: sticky;
    top: 8px;
    z-index: 4;
    min-height: 0;
    margin: 0 0 10px;
    font-size: 0.92rem;
    font-weight: 700;
}
.ipp-mat-autosave:empty { display: none; }
.ipp-mat-autosave.is-pending { color: #475569; }
.ipp-mat-autosave.is-saved { color: #065f46; }
.ipp-mat-autosave.is-error { color: #991b1b; }

.ipp-mat-sticky-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
@media (min-width: 600px) {
    .ipp-mat-sticky-bar {
        flex-direction: row;
        justify-content: flex-end;
    }
}

.ipp-mat-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 0.96rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.ipp-mat-btn-primary {
    background: #0f2a4a;
    color: #ffffff;
}
.ipp-mat-btn-primary:hover { background: #1e3a5f; }
.ipp-mat-btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}
.ipp-mat-btn-secondary:hover { background: #cbd5e1; }

.ipp-mat-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    font-size: 0.93rem;
}
@media (min-width: 640px) {
    .ipp-mat-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
.ipp-mat-doc-readonly-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ipp-mat-doc-readonly-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8fafc;
}
.ipp-mat-landing {
    position: relative;
}
.ipp-mat-resume-corner {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    max-width: min(340px, calc(100% - 32px));
}
.ipp-mat-resume-corner > summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    list-style: none;
}
.ipp-mat-resume-corner > summary::-webkit-details-marker {
    display: none;
}
.ipp-mat-resume-corner:not([open]) > :not(summary) {
    display: none !important;
}
.ipp-mat-resume-corner[open] {
    padding: 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ipp-mat-resume-corner[open] > summary {
    margin-bottom: 10px;
}
.ipp-mat-landing > h2 {
    padding-right: 210px;
}
@media (max-width: 640px) {
    .ipp-mat-resume-corner {
        position: static;
        max-width: none;
        margin-bottom: 12px;
        text-align: right;
    }
    .ipp-mat-landing > h2 {
        padding-right: 0;
    }
}
.ipp-mat-choice-grid,
.ipp-mat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ipp-mat-actions { margin-top: 14px; }
.ipp-mat-account-offer { border-style: dashed; }
.ipp-mat-wrap .ipp-mat-btn { font-family: inherit; }
