/**************************************************
 * Dravsy Membership – Estilo “premium” con plantillas
 * Plantillas de planes:
 *  - cards   (por defecto, tarjetas destacadas)
 *  - minimal (plano / limpio)
 *  - columns (columnas tipo tabla comparativa)
 **************************************************/

:root {
    --dm-primary: #ff5a5f;
    --dm-primary-dark: #e0484d;
    --dm-primary-soft: rgba(255, 90, 95, 0.08);
    --dm-accent: #00a8a8;
    --dm-bg-body: #f4f5f7;
    --dm-border: #dde1e7;
    --dm-text-main: #232938;
    --dm-text-muted: #6b7280;
    --dm-radius-card: 14px;
    --dm-shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
}

/**************************************************
 * CONTENEDORES GENERALES
 **************************************************/

.dm-wrap,
.dm-account,
.dm-form,
.dm-plans-wrapper,
.dm-activity-log {
    max-width: 1120px;
    margin: 0 auto 32px;
    padding: 24px 26px;
    border-radius: var(--dm-radius-card);
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: var(--dm-shadow-soft);
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dm-text-main);
}

/* Títulos dentro de los bloques del plugin */
.dm-account h1,
.dm-account h2,
.dm-account h3,
.dm-form h1,
.dm-form h2,
.dm-form h3,
.dm-plans-wrapper h1,
.dm-plans-wrapper h2,
.dm-plans-wrapper h3,
.dm-activity-log h1,
.dm-activity-log h2,
.dm-activity-log h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 700;
    color: var(--dm-text-main);
}

.dm-account h2,
.dm-form h2,
.dm-plans-wrapper h2,
.dm-activity-log h2 {
    font-size: 22px;
}

.dm-account h3,
.dm-form h3,
.dm-plans-wrapper h3,
.dm-activity-log h3 {
    font-size: 18px;
}

/**************************************************
 * FORMULARIOS (registro, login, canje, cambio plan)
 **************************************************/

.dm-form p,
.dm-account p {
    margin: 0 0 12px;
}

.dm-form label,
.dm-account label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dm-text-main);
}

.dm-form input[type="text"],
.dm-form input[type="email"],
.dm-form input[type="password"],
.dm-form input[type="url"],
.dm-form input[type="number"],
.dm-form input[type="tel"],
.dm-form select,
.dm-form textarea,
.dm-account input[type="text"],
.dm-account input[type="email"],
.dm-account input[type="password"],
.dm-account input[type="url"],
.dm-account input[type="number"],
.dm-account input[type="tel"],
.dm-account select,
.dm-account textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.dm-form textarea,
.dm-account textarea {
    min-height: 110px;
    resize: vertical;
}

.dm-form input:focus,
.dm-form select:focus,
.dm-form textarea:focus,
.dm-account input:focus,
.dm-account select:focus,
.dm-account textarea:focus {
    outline: none;
    border-color: var(--dm-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(255, 90, 95, 0.25);
}

/**************************************************
 * BOTONES
 **************************************************/

.dm-form button,
.dm-form input[type="submit"],
.dm-account button,
.dm-account input[type="submit"],
.dm-plan-actions button,
.dm-plan-actions input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--dm-primary), var(--dm-primary-dark));
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    box-shadow: 0 10px 18px rgba(255, 90, 95, 0.35);
}

.dm-form button:hover,
.dm-form input[type="submit"]:hover,
.dm-account button:hover,
.dm-account input[type="submit"]:hover,
.dm-plan-actions button:hover,
.dm-plan-actions input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(255, 90, 95, 0.4);
}

.dm-form button:active,
.dm-form input[type="submit"]:active,
.dm-account button:active,
.dm-account input[type="submit"]:active,
.dm-plan-actions button:active,
.dm-plan-actions input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(255, 90, 95, 0.35);
}

.dm-form button:disabled,
.dm-form input[type="submit"]:disabled,
.dm-account button:disabled,
.dm-account input[type="submit"]:disabled,
.dm-plan-actions button:disabled,
.dm-plan-actions input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

/* Enlaces con aspecto de botón principal dentro del plugin */
.dm-plan a,
.dm-form a.dm-button,
.dm-account a.dm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--dm-primary), var(--dm-primary-dark));
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 10px 18px rgba(255, 90, 95, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.dm-plan a:hover,
.dm-form a.dm-button:hover,
.dm-account a.dm-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(255, 90, 95, 0.4);
}

/**************************************************
 * MENSAJES (errores, avisos, info)
 **************************************************/

.dm-errors,
.dm-error,
.dm-message-error {
    margin-bottom: 16px;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    background: #fef2f2;
    color: #b91c1c;
}

.dm-errors p:last-child {
    margin-bottom: 0;
}

.dm-restrict-message,
.dm-message,
.dm-message-success {
    margin-bottom: 16px;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1px solid rgba(22, 163, 74, 0.25);
    background: #ecfdf3;
    color: #166534;
}

.dm-info-message {
    margin-bottom: 16px;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    background: #eff6ff;
    color: #1d4ed8;
}

/**************************************************
 * LISTADO DE PLANES – BASE (plantilla "cards")
 **************************************************/

.dm-plans-wrapper {
    max-width: 1120px;
    margin: 0 auto 32px;
    padding: 26px 26px 30px;
    border-radius: 20px;
    background: radial-gradient(circle at top left, #fff7f3 0, #ffffff 55%, #f4fbfb 100%);
    border: none;
    box-shadow: var(--dm-shadow-soft);
}

/* Título y subtítulo de la sección de precios */
.dm-plans-wrapper > h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 26px;
    font-weight: 800;
}

.dm-plans-wrapper > p.dm-plans-subtitle {
    text-align: center;
    margin: 0 0 22px;
    font-size: 14px;
    color: var(--dm-text-muted);
}

/* Grid de planes */
.dm-plans {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

/* Tarjeta de plan */
.dm-plan {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 22px 20px 20px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 320px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

/* Ocultar radios/checkbox si existen */
.dm-plan input[type="radio"],
.dm-plan input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Destacar plan central como "Más popular" (plantilla cards) */
.dm-plan:nth-child(2) {
    border-color: var(--dm-primary);
    box-shadow: 0 18px 34px rgba(255, 90, 95, 0.2);
    transform: translateY(-4px);
}

.dm-plan:nth-child(2)::before {
    content: "Más popular";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--dm-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Hover */
.dm-plan:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
    border-color: rgba(15, 23, 42, 0.18);
}

/* Título del plan (detectamos varios casos) */
.dm-plan h2,
.dm-plan h3,
.dm-plan .dm-plan-title,
.dm-plan .level-title,
.dm-plan > strong:first-child,
.dm-plan > span:first-child {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--dm-text-main);
    text-align: center;
}

/* Precio */
.dm-plan .dm-plan-price,
.dm-plan .price,
.dm-plan .dm-price,
.dm-plan strong:not(:first-child) {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--dm-primary-dark);
    text-align: center;
    margin: 4px 0 0;
}

/* Sublinea (por ejemplo “/mes”) */
.dm-plan .dm-plan-subline {
    font-size: 13px;
    color: var(--dm-text-muted);
    text-align: center;
    margin-top: 2px;
}

/* Texto / descripción general del plan */
.dm-plan p {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--dm-text-muted);
}

/* Lista de features si hay <ul> */
.dm-plan ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--dm-text-muted);
}

.dm-plan ul li {
    margin-bottom: 4px;
    padding-left: 16px;
    position: relative;
}

.dm-plan ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--dm-accent);
}

/* Separador interno */
.dm-plan hr,
.dm-plan .dm-plan-separator {
    margin: 14px 0;
    border: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* Zona del botón */
.dm-plan-actions {
    margin-top: auto;
    padding-top: 14px;
    text-align: center;
}

/* Enlace-botón de la tarjeta (si el shortcode lo genera) */
.dm-plan-actions a,
.dm-plan a {
    margin-top: 6px;
    width: 100%;
    max-width: 220px;
}

/* Nota bajo el grid */
.dm-plans-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--dm-text-muted);
}

/**************************************************
 * PLANTILLA "MINIMAL"
 * body.dm-plan-template-minimal …
 **************************************************/

body.dm-plan-template-minimal .dm-plans-wrapper {
    background: #ffffff;
    box-shadow: none;
    border: 1px solid var(--dm-border);
}

body.dm-plan-template-minimal .dm-plan {
    box-shadow: none;
    border-radius: 10px;
    border: 1px solid var(--dm-border);
    transform: none;
}

body.dm-plan-template-minimal .dm-plan:hover {
    transform: none;
    box-shadow: none;
    border-color: #cbd5e1;
}

/* Sin "Más popular" visual */
body.dm-plan-template-minimal .dm-plan:nth-child(2) {
    border-color: var(--dm-border);
}

body.dm-plan-template-minimal .dm-plan:nth-child(2)::before {
    display: none;
}

/* Botón más sobrio */
body.dm-plan-template-minimal .dm-plan a,
body.dm-plan-template-minimal .dm-plan-actions a {
    box-shadow: none;
    background: #4b5563;
    background-image: none;
    text-transform: none;
    letter-spacing: 0;
}

body.dm-plan-template-minimal .dm-plan a:hover,
body.dm-plan-template-minimal .dm-plan-actions a:hover {
    transform: none;
    box-shadow: none;
    background: #111827;
}

/**************************************************
 * PLANTILLA "COLUMNS"
 * body.dm-plan-template-columns …
 **************************************************/

body.dm-plan-template-columns .dm-plans-wrapper {
    background: #f9fafb;
    box-shadow: none;
    border-radius: 14px;
}

body.dm-plan-template-columns .dm-plans {
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--dm-border);
}

/* Columnas con borde vertical entre ellas */
body.dm-plan-template-columns .dm-plan {
    box-shadow: none;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--dm-border);
    min-height: 0;
    padding-top: 0;
    padding-bottom: 18px;
}

body.dm-plan-template-columns .dm-plan:last-child {
    border-right: 0;
}

/* Cabecera coloreada */
body.dm-plan-template-columns .dm-plan-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--dm-border);
    background: #ffffff;
}

/* Si no hay .dm-plan-header explícito, simulamos usando los primeros elementos */
body.dm-plan-template-columns .dm-plan h2,
body.dm-plan-template-columns .dm-plan h3,
body.dm-plan-template-columns .dm-plan .dm-plan-title,
body.dm-plan-template-columns .dm-plan .level-title,
body.dm-plan-template-columns .dm-plan > strong:first-child,
body.dm-plan-template-columns .dm-plan > span:first-child {
    margin-top: 14px;
}

/* Plan central con cabecera de color */
body.dm-plan-template-columns .dm-plan:nth-child(2) {
    position: relative;
}

body.dm-plan-template-columns .dm-plan:nth-child(2)::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 90, 95, 0.1), rgba(0, 168, 168, 0.06));
    pointer-events: none;
}

/* Precio más grande en columns */
body.dm-plan-template-columns .dm-plan .dm-plan-price,
body.dm-plan-template-columns .dm-plan .price,
body.dm-plan-template-columns .dm-plan .dm-price,
body.dm-plan-template-columns .dm-plan strong:not(:first-child) {
    font-size: 24px;
}

/* Botones más planos */
body.dm-plan-template-columns .dm-plan a,
body.dm-plan-template-columns .dm-plan-actions a {
    box-shadow: none;
    background-image: none;
    background: var(--dm-primary);
}

/**************************************************
 * ÁREA DE CUENTA
 **************************************************/

.dm-account-details {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f4f7ff, #fef6f4);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.dm-account-details p {
    margin: 0 0 4px;
}

/* Secciones separadas en la cuenta */
.dm-account-section {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

/**************************************************
 * HISTORIAL DE ACTIVIDAD (frontend)
 **************************************************/

.dm-activity-log {
    margin-top: 24px;
}

.dm-activity-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dm-activity-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dm-activity-item:last-child {
    border-bottom: 0;
}

.dm-activity-date {
    width: 160px;
    font-size: 12px;
    color: var(--dm-text-muted);
    padding-right: 10px;
    box-sizing: border-box;
}

.dm-activity-body {
    flex: 1;
}

.dm-activity-title {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--dm-text-main);
}

.dm-activity-content p {
    margin: 0;
    font-size: 13px;
    color: var(--dm-text-muted);
}

/**************************************************
 * DRIP CONTENT: vista previa + progreso
 **************************************************/

.dm-drip-message {
    margin-top: 18px;
}

.dm-drip-progress {
    margin: 12px 0 14px;
    width: 100%;
    max-width: 420px;
    height: 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.dm-drip-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--dm-primary), var(--dm-accent));
    transition: width 0.25s ease;
}

.dm-drip-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px dashed rgba(15, 23, 42, 0.12);
}

.dm-drip-preview-title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dm-text-main);
}

.dm-drip-preview p {
    margin: 0;
    font-size: 13px;
    color: var(--dm-text-muted);
}

/**************************************************
 * TABLAS
 **************************************************/

.dm-account table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 13px;
}

.dm-account table th,
.dm-account table td {
    padding: 7px 8px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    text-align: left;
}

.dm-account table th {
    background-color: #f9fafb;
    font-weight: 600;
}

/**************************************************
 * RESPONSIVE
 **************************************************/

@media (max-width: 900px) {
    .dm-account,
    .dm-form,
    .dm-plans-wrapper,
    .dm-activity-log {
        padding: 18px 18px 20px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    }

    .dm-plan:nth-child(2) {
        transform: translateY(0);
    }

    .dm-plan:nth-child(2)::before {
        top: 10px;
    }
}

@media (max-width: 640px) {
    .dm-activity-item {
        flex-direction: column;
    }

    .dm-activity-date {
        width: auto;
        margin-bottom: 4px;
    }
}
