/* MiEventus — Dashboard, onboarding y autenticación del cliente. */

.mieventus-app {
    /* El dorado anterior (#c79b4a) daba solo 2.55:1 contra blanco. Estos
       tonos conservan la identidad cálida y cumplen WCAG AA en texto y
       botones (>= 4.5:1). */
    --mea-accent: #805b1e;
    --mea-accent-dark: #684812;
    --mea-text: #252321;
    --mea-muted: #6c6861;
    --mea-bg: #faf8f4;
    --mea-surface: #ffffff;
    --mea-error: #b3261e;
    --mea-ok: #2e7d32;
    font-family: "Montserrat", "Segoe UI", sans-serif;
    color: var(--mea-text);
    line-height: 1.6;
}

.mieventus-app *, .mieventus-app *::before, .mieventus-app *::after { box-sizing: border-box; }

/* Los temas de WordPress (Divi, etc.) pueden pisar el atributo hidden con sus estilos de form */
.mieventus-app [hidden] { display: none !important; }

.mieventus-app h2, .mieventus-app h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }

/* ---------- Autenticación ---------- */

.me-auth { display: grid; gap: 2rem; padding: 1rem 0 3rem; }

@media (min-width: 900px) {
    .me-auth { grid-template-columns: 1.1fr 1fr; align-items: start; }
}

.me-auth__benefits { list-style: none; padding: 0; }
.me-auth__benefits li { padding-left: 1.6rem; position: relative; margin: .5rem 0; }
.me-auth__benefits li::before { content: "✓"; color: var(--mea-accent); position: absolute; left: 0; }

.me-tabs { background: var(--mea-surface); border: 1px solid #e8e2d8; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 30px rgba(0,0,0,.06); }

.me-tabs__nav { display: flex; border-bottom: 1px solid #e8e2d8; }
.me-tabs__nav button {
    flex: 1; padding: .9rem; background: #f4efe7; border: 0; cursor: pointer;
    font-size: .95rem; color: var(--mea-muted);
}
.me-tabs__nav button.is-active { background: var(--mea-surface); color: var(--mea-text); font-weight: 600; }

.me-form { display: flex; flex-direction: column; gap: .9rem; padding: 1.4rem; }
.me-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; }
.me-form input[type="text"], .me-form input[type="email"], .me-form input[type="password"],
.me-form input[type="tel"], .me-form input[type="date"], .me-form select {
    padding: .65rem .8rem; border: 1px solid #d8d2c6; border-radius: 8px; font-size: 1rem;
}
.me-form input:focus, .me-form select:focus { outline: 2px solid var(--mea-accent); outline-offset: 1px; border-color: var(--mea-accent); }
.me-form__check { flex-direction: row !important; align-items: flex-start; gap: .55rem !important; }
.me-form__error { color: var(--mea-error); background: #fdeceb; border-radius: 8px; padding: .7rem 1rem; }

.me-btn-primary {
    background: var(--mea-accent); color: #fff; border: 0; border-radius: 999px;
    padding: .8rem 2rem; font-size: 1rem; cursor: pointer; letter-spacing: .03em;
}
.me-btn-primary:hover { background: var(--mea-accent-dark); }
.me-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.me-btn-secondary {
    background: transparent; color: var(--mea-accent); border: 1px solid var(--mea-accent);
    border-radius: 999px; padding: .75rem 1.8rem; font-size: .95rem; cursor: pointer;
    text-decoration: none; display: inline-block;
}

.me-btn-link { background: none; border: 0; color: var(--mea-muted); cursor: pointer; text-decoration: underline; font-size: .88rem; }

/* ---------- Onboarding ---------- */

.me-onboarding { max-width: 620px; margin: 0 auto; padding: 1rem 0 3rem; }

.me-ob-progress { display: flex; gap: 6px; margin-bottom: 1.6rem; }
.me-ob-progress span { flex: 1; height: 4px; background: #e6dfd2; border-radius: 4px; }
.me-ob-progress span.is-done { background: var(--mea-accent); }

.me-ob-step h2 { margin: 0 0 .4rem; font-size: 1.6rem; }
.me-ob-step > p { color: var(--mea-muted); margin-top: 0; }

.me-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin: 1.2rem 0; }
.me-choice {
    border: 1.5px solid #ddd5c8; background: var(--mea-surface); border-radius: 12px;
    padding: 1.1rem .9rem; cursor: pointer; text-align: center; font-size: .95rem;
}
.me-choice:hover { border-color: var(--mea-accent); }
.me-choice.is-selected { border-color: var(--mea-accent); background: #fdf8ef; box-shadow: 0 0 0 1px var(--mea-accent); }
.me-choice__emoji { font-size: 1.7rem; display: block; margin-bottom: .3rem; }

.me-ob-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.6rem; }

.me-slug-field { display: flex; align-items: center; gap: .1rem; border: 1px solid #d8d2c6; border-radius: 8px; padding: .3rem .8rem; background: #fff; flex-wrap: wrap; }
.me-slug-field span { color: var(--mea-muted); font-size: .88rem; }
.me-slug-field input { border: 0 !important; outline: none !important; flex: 1; min-width: 140px; font-size: 1rem; padding: .4rem 0 !important; }
.me-slug-status { font-size: .85rem; margin-top: .4rem; min-height: 1.2em; }
.me-slug-status.is-ok { color: var(--mea-ok); }
.me-slug-status.is-bad { color: var(--mea-error); }

/* ---------- Dashboard ---------- */

.me-dashboard { padding: 1rem 0 3rem; }
.me-event-tools { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.me-event-tools label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.me-event-tools select { min-width: min(20rem, 78vw); }

.me-dash-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1.4rem; }
.me-dash-head h2 { margin: 0; font-size: 1.7rem; }

.me-badge { display: inline-block; border-radius: 999px; padding: .15rem .8rem; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.me-badge--draft { background: #f4efe7; color: #66552c; }
.me-badge--published { background: #e6f2e7; color: var(--mea-ok); }
.me-badge--unpublished { background: #fdeceb; color: var(--mea-error); }

.me-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.me-card {
    background: var(--mea-surface); border: 1px solid #e8e2d8; border-radius: 12px;
    padding: 1.2rem 1.3rem; box-shadow: 0 3px 16px rgba(0,0,0,.04);
}
.me-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.me-card p { margin: .3rem 0; font-size: .92rem; }
.me-card .me-muted { color: var(--mea-muted); }

.me-url-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.me-url-row code { background: #f4efe7; padding: .3rem .6rem; border-radius: 6px; font-size: .85rem; word-break: break-all; }

.me-progress-list { list-style: none; padding: 0; margin: .4rem 0 0; }
.me-progress-list li { padding-left: 1.5rem; position: relative; margin: .3rem 0; font-size: .92rem; }
.me-progress-list li::before { content: "○"; position: absolute; left: 0; color: var(--mea-muted); }
.me-progress-list li.is-done::before { content: "✓"; color: var(--mea-ok); }

.me-progress-bar { height: 8px; border-radius: 6px; background: #eee7da; overflow: hidden; margin: .5rem 0; }
.me-progress-bar b { display: block; height: 100%; background: var(--mea-accent); }

.me-dash-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

.me-toast {
    position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
    background: var(--mea-text); color: #fff; border-radius: 8px; padding: .7rem 1.4rem;
    font-size: .9rem; z-index: 9999; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.me-toast.is-error { background: var(--mea-error); }

.me-form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; margin-top: .8rem; }
@media (min-width: 640px) { .me-form-grid { grid-template-columns: 1fr 1fr; } }
.me-form-grid label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; }
.me-form-grid input, .me-form-grid select {
    padding: .6rem .75rem; border: 1px solid #d8d2c6; border-radius: 8px; font-size: .98rem;
}

.me-modal-note { font-size: .85rem; color: var(--mea-muted); }

.me-dialog-backdrop {
    position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center;
    padding: 1rem; background: rgba(0,0,0,.55);
}
.me-dialog { width: min(440px, 100%); padding: 1.25rem; border-radius: 12px; background: var(--mea-surface); box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.me-dialog h3 { margin-top: 0; }
.me-dialog__actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1rem; }

.me-csv-preview { margin-top: .75rem; overflow-x: auto; }
.me-csv-preview table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.me-csv-preview caption { text-align: left; font-weight: 700; margin-bottom: .35rem; }
.me-csv-preview th,
.me-csv-preview td { border: 1px solid #d8d2c6; padding: .35rem .45rem; text-align: left; }
.me-csv-preview th { background: #f5f1ea; }

/* ---------- Panel de diseño ---------- */

.me-thumb {
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.08);
    padding: 1.1rem .8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    min-height: 108px;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.me-thumb--big { min-height: 150px; }

.me-thumb__names { font-size: 1.15rem; line-height: 1.15; }
.me-thumb--big .me-thumb__names { font-size: 1.5rem; }
.me-thumb__meta { font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; }
.me-thumb__nav { font-size: .5rem; letter-spacing: .08em; border-top: 1px solid; padding-top: .3rem; opacity: .75; }

.me-theme-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.me-theme-grid__title { margin: 1.6rem 0 .8rem; }

.me-theme-card {
    background: var(--mea-surface);
    border: 2px solid #e8e2d8;
    border-radius: 12px;
    padding: .7rem;
    cursor: pointer;
}

.me-theme-card:hover { border-color: var(--mea-accent); }
.me-theme-card.is-selected { border-color: var(--mea-accent); box-shadow: 0 0 0 1px var(--mea-accent); }

.me-theme-card__name { margin: .55rem 0 .3rem; font-weight: 600; font-size: .92rem; }

.me-dots { display: flex; gap: .45rem; flex-wrap: wrap; margin: .3rem 0; }

.me-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.2);
    cursor: pointer;
    padding: 0;
}

.me-dot.is-selected { outline: 2px solid var(--mea-text); outline-offset: 2px; }

.me-design-current__row { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .me-design-current__row { grid-template-columns: 240px 1fr; } }

.me-font-label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; margin: .8rem 0; max-width: 320px; }
.me-font-select { padding: .55rem .7rem; border: 1px solid #d8d2c6; border-radius: 8px; font-size: .95rem; }

.me-layouts { display: flex; gap: .6rem; flex-wrap: wrap; }

.me-layout-opt {
    background: var(--mea-surface);
    border: 2px solid #e8e2d8;
    border-radius: 10px;
    padding: .5rem;
    cursor: pointer;
    width: 86px;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-items: stretch;
}

.me-layout-opt.is-selected { border-color: var(--mea-accent); box-shadow: 0 0 0 1px var(--mea-accent); }
.me-layout-opt small { font-size: .68rem; color: var(--mea-muted); text-align: center; }

.me-layout-diagram { display: flex; gap: 4px; align-items: stretch; flex-wrap: wrap; }

.me-layout-cell { border-radius: 3px; flex: 1; }
.me-layout-cell--t { background: #d9d2c4; width: 100%; }
.me-layout-cell--t2 { background: #d9d2c4; }
.me-layout-cell--p, .me-layout-cell--p2 { background: var(--mea-accent); opacity: .75; }
.me-layout-cell--p { width: 100%; }
.me-layout-cell--pf { background: var(--mea-accent); opacity: .75; width: 100%; }
