:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef2f8;
    --border: #d9e2ec;
    --text: #243447;
    --muted: #6b7c93;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #b91c1c;
    --success: #15803d;
    --warning: #b45309;
    --info: #1d4ed8;
    --shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    --radius: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    font-size: 22px;
    font-weight: bold;
    color: var(--text);
}

.brand-area .brand {
    text-decoration: none;
}

.topbar-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.topbar-nav a {
    font-weight: 600;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

.page-container {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    width: 100%;
}

.lead.text-muted,
.text-muted {
    color: var(--muted);
}

.text-danger {
    color: var(--danger);
}

h1 {
    margin-top: 0;
}

/* Páginas públicas (alineado a la estética de formularios PlanMant) */
.page-header {
    margin-bottom: 1.25rem;
}

.page-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--muted);
    max-width: 42rem;
}

.info-panel {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 60%);
    box-shadow: var(--shadow);
}

.info-panel__title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.proceso-pasos {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.proceso-pasos li {
    margin-bottom: 0.35rem;
}

.proceso-pasos li:last-child {
    margin-bottom: 0;
}

.form-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 900px) {
    .form-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: start;
    }

    .form-main .form-card {
        max-width: 100%;
    }
}

.form-sidebar .info-panel {
    margin-bottom: 0;
}

.form-section-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.field-hint,
.form-hint {
    margin: 0.35rem 0 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted);
}

.fieldset-modalidad {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1rem 0.75rem;
    background: #f8fafc;
}

.fieldset-modalidad legend {
    padding: 0 0.35rem;
    font-weight: 700;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
}

.radio-label input {
    width: auto;
    accent-color: var(--primary);
}

.control:focus-visible,
.radio-label input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.control:hover {
    border-color: #94a3b8;
}

.public-footer-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--muted);
}

body.page-adquirir .public-footer-note--adquirir {
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #64748b;
}

.gracias-card .reference-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 700;
    font-size: 0.95rem;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    max-width: 560px;
}

.form-card.narrow {
    max-width: 420px;
}

.field {
    margin-bottom: 16px;
}

.field legend {
    font-weight: 700;
    margin-bottom: 8px;
}

.radio-label {
    display: block;
    margin-bottom: 6px;
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}

.field-error {
    color: var(--danger);
    font-size: 14px;
    display: block;
}

.field-errors-block .field-error + .field-error {
    margin-top: 0.25rem;
}

.field--invalid .control {
    border-color: var(--danger);
}

.field--invalid .field-errors-block {
    margin-top: 0.35rem;
}

.field--invalid .field-error {
    font-weight: 600;
}

.form-error-summary {
    margin: 0 0 1.25rem 0;
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.form-error-summary__title {
    margin: 0 0 0.65rem 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
}

.form-error-summary__list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-error-summary__list a {
    color: #b91c1c;
    font-weight: 600;
    text-decoration: underline;
}

.form-error-summary__list a:hover {
    color: #7f1d1d;
}

.actions {
    margin-top: 24px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #f8fafc;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.badge-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.badge-aprobada {
    background: #dcfce7;
    color: #166534;
}

.badge-rechazada {
    background: #fee2e2;
    color: #991b1b;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pendiente_verificacion_email {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-espera {
    background: #fef3c7;
    color: #92400e;
}

.detail-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 16px;
}

.detail-list dt {
    font-weight: 700;
    margin: 0;
}

.detail-list dd {
    margin: 0;
}

.acciones-solicitud {
    margin: 24px 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.inline-actions {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 12px;
}

.app-footer {
    border-top: 1px solid var(--border);
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.app-footer-text {
    margin: 0;
}

/* Ayuda contextual (macro ayuda_panel), alineado con PlanMant */
.page-help {
    margin: 0 0 20px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 0;
}

.page-help-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    user-select: none;
}

.page-help summary::-webkit-details-marker {
    display: none;
}

.page-help summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.15s ease;
    margin-right: 4px;
}

.page-help[open] summary::before {
    transform: rotate(90deg);
}

.page-help-body {
    padding: 0 14px 14px 14px;
    border-top: 1px solid var(--border);
}

.page-help-list {
    margin: 12px 0 0 0;
    padding-left: 1.25rem;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.page-help-list li + li {
    margin-top: 8px;
}

.lead.text-muted + .page-help {
    margin-top: 12px;
}

.help-doc {
    max-width: 52rem;
}

.help-doc header h1 {
    margin-bottom: 0.5rem;
}

.help-doc .lead {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.help-doc h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.35rem;
}

.help-doc h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--text);
}

.help-doc p {
    margin: 0.5rem 0 1rem;
    line-height: 1.55;
}

.help-doc ul {
    margin: 0.35rem 0 1rem 1.25rem;
    line-height: 1.55;
}

.help-doc li + li {
    margin-top: 0.35rem;
}

.help-doc code {
    font-size: 0.9em;
    background: var(--surface-2);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.help-doc-footer {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* --- Página pública /adquirir (contratación) --- */
body.page-adquirir .page-container {
    max-width: 1140px;
}

.adquirir-hero {
    margin-bottom: 1.75rem;
}

.adquirir-hero__title {
    margin: 0 0 0.5rem 0;
    font-size: clamp(1.65rem, 2.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.adquirir-hero__trial {
    font-weight: 800;
    color: #1e40af;
    font-size: 1.12em;
    letter-spacing: -0.01em;
}

.adquirir-hero__subtitle {
    margin: 0 0 1.25rem 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 40rem;
}

.adquirir-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
    color: var(--muted);
}

.adquirir-trust li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.adquirir-trust li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--primary);
    opacity: 0.65;
}

.adquirir-product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow);
}

.adquirir-product-card__name {
    margin: 0 0 0.5rem 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}

.adquirir-product-card__lead {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--muted);
    max-width: 46rem;
}

.adquirir-product-card__bullets {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text);
    line-height: 1.55;
    font-size: 0.95rem;
}

.adquirir-product-card__bullets li + li {
    margin-top: 0.35rem;
}

.adquirir-pricing {
    margin-bottom: 1.75rem;
}

.adquirir-pricing__heading {
    margin: 0 0 0.35rem 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.adquirir-pricing__intro {
    margin: 0 0 1rem 0;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.5;
    max-width: 42rem;
}

.adquirir-pricing__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .adquirir-pricing__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }
}

.price-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.price-card:hover,
.price-card:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.price-card--recommended {
    border-color: #93c5fd;
    background: linear-gradient(165deg, #eff6ff 0%, #ffffff 55%);
    box-shadow: var(--shadow);
}

.price-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e40af;
    background: #dbeafe;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.price-card__title {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    padding-right: 5rem;
}

.price-card--recommended .price-card__title {
    padding-right: 6.5rem;
}

.price-card__sub {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.45;
}

.price-card__lines {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.92rem;
}

.price-card__lines li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0.45rem 0;
    border-top: 1px solid var(--border);
}

.price-card__lines li:first-child {
    border-top: none;
    padding-top: 0;
}

.price-card__lines span {
    color: var(--muted);
}

.price-card__lines strong {
    color: var(--text);
    font-weight: 700;
}

.price-card__annual-bill {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.45;
}

.adquirir-pricing__legal {
    margin: 0.85rem 0 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
    max-width: 46rem;
}

.form-layout--adquirir {
    align-items: start;
}

.form-card--adquirir {
    max-width: none;
}

.form-sidebar .info-panel + .info-panel {
    margin-top: 1rem;
}

.info-panel--resumen {
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 65%);
}

.adquirir-highlight {
    margin: 0.85rem 0 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.proceso-pasos--compact {
    font-size: 0.9rem;
}

.form-hint--tight {
    margin-top: 0.65rem;
}

.field-costo-mensual {
    margin: 0.65rem 0 0 0;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.45;
}

.field-costo-mensual strong {
    font-weight: 700;
    color: var(--text);
}

.adquirir-next {
    margin-top: 2rem;
    padding: 1.5rem 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.adquirir-next__title {
    margin: 0 0 1.15rem 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.adquirir-next__steps {
    margin: 0;
    padding: 0;
    list-style: none;
}

.adquirir-next__steps > li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
}

.adquirir-next__steps > li:first-child {
    border-top: none;
    padding-top: 0;
}

.adquirir-next__num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adquirir-next__steps strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.adquirir-next__detail {
    display: block;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.45;
}

.adquirir-next__footer {
    margin: 1.25rem 0 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

.btn--adquirir-submit {
    min-height: 48px;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
    font-size: 1rem;
}

@media (min-width: 900px) {
    .form-layout--adquirir {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}
