/* ==========================================================================
   CREA · sistema de diseño
   --------------------------------------------------------------------------
   Lenguaje visual inspirado en eventline.com.mx: ciruela profundo sobre
   blanco, acento en oro cálido y tintes crema/blush. Los títulos son
   Playfair Display 500 con tracking negativo y en frase normal —nada de
   versalitas espaciadas— y los botones son píldoras de contorno.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
    /* Marca */
    --plum:        #341635;
    --plum-soft:   #5d3b60;
    --plum-wash:   rgba(52, 22, 53, .08);
    --gold:        #ffc168;
    --gold-deep:   #e0a04a;
    --gold-wash:   rgba(255, 193, 104, .16);

    /* Neutros */
    --ink:         #341635;
    --body:        #495057;
    --muted:       #95929a;
    --white:       #ffffff;
    --cream:       #fcf5f1;
    --blush:       #ffeef2;
    --line:        #ece7e9;
    --line-soft:   #f5f1f2;

    /* Estados */
    --ok:          #4d7c5a;
    --danger:      #c0504d;
    --warn:        #c98a2e;

    --serif: 'Playfair Display', Georgia, serif;
    --sans:  'Montserrat', -apple-system, 'Segoe UI', Roboto, sans-serif;

    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-pill: 999px;

    --shadow-sm: 0 4px 8px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-md: 0 8px 24px rgba(52, 22, 53, .09);
    --shadow-lg: 0 18px 48px rgba(52, 22, 53, .16);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: -.01em;
    color: var(--body);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

body.bg-cream { background: var(--cream); }

a { color: var(--plum); text-decoration: none; }
a:hover { color: var(--gold-deep); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--ink);
    margin: 0;
    line-height: 1.18;
    letter-spacing: -.012em;
}

/* --- Tipografía utilitaria ------------------------------------------------ */

.display    { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 4vw, 48px); color: var(--ink); letter-spacing: -.015em; }
.display-sm { font-family: var(--serif); font-weight: 500; font-size: 28px; color: var(--ink); letter-spacing: -.012em; }

/* Antes esto era una versalita espaciada; ahora es solo texto secundario. */
.eyebrow {
    font-size: 14px;
    font-weight: 500;
    color: var(--gold-deep);
    margin: 0 0 10px;
    letter-spacing: -.01em;
}

.lead  { color: var(--muted); font-size: 16px; margin: 10px 0 0; }
.hint  { color: var(--muted); font-size: 14px; line-height: 1.6; }
.muted { color: var(--muted); }

/* --- Botones -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 28px;
    border: 2px solid transparent;
    border-radius: var(--r-pill);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -.01em;
    cursor: pointer;
    background: none;
    color: var(--ink);
    transition: background-color .18s ease, border-color .18s ease,
                color .18s ease, transform .18s ease, box-shadow .18s ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* Sólido ciruela: la acción principal de cada pantalla. */
.btn-primary {
    background: var(--plum);
    border-color: var(--plum);
    color: #fff;
}
.btn-primary:not(:disabled):hover {
    background: var(--plum-soft);
    border-color: var(--plum-soft);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Contorno: el patrón de botón de EventLine. */
.btn-ghost {
    background: transparent;
    border-color: rgba(52, 22, 53, .3);
    color: var(--ink);
}
.btn-ghost:not(:disabled):hover { border-color: var(--plum); background: var(--plum-wash); }

/* Oro: acentos puntuales, nunca dos en la misma vista. */
.btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--plum);
}
.btn-gold:not(:disabled):hover {
    background: var(--gold-deep);
    border-color: var(--gold-deep);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-link {
    min-height: auto;
    padding: 0;
    border: 0;
    font-size: 15px;
    color: var(--plum);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(52, 22, 53, .3);
}
.btn-link:hover { color: var(--gold-deep); text-decoration-color: var(--gold-deep); }

.btn-block { width: 100%; }
.btn-sm    { min-height: 38px; padding: 0 18px; font-size: 14px; border-width: 1px; }

/* Los iconos dentro de un botón quedan un punto por debajo del texto para
   que no compitan con él. */
.btn i { font-size: .92em; opacity: .85; }

/* --- Botón de acción circular --------------------------------------------
   Para acciones sobre una fila (editar, borrar). Discreto en reposo y con
   color solo al pasar por encima, para que una lista larga no parezca un
   tablero de mandos. */

.icon-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.icon-btn:hover {
    color: var(--plum);
    border-color: rgba(52, 22, 53, .32);
    background: var(--cream);
}
.icon-btn:focus-visible {
    outline: none;
    border-color: var(--plum);
    box-shadow: 0 0 0 4px var(--plum-wash);
}
.icon-btn.is-danger:hover {
    color: var(--danger);
    border-color: rgba(192, 80, 77, .45);
    background: #fdf3f2;
}
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Enlace con forma de texto, usado en paneles y repetidores. */
.link-btn {
    border: 0;
    background: none;
    cursor: pointer;
    padding: 0;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--plum);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.link-btn:hover { color: var(--gold-deep); }
.link-btn.danger { color: var(--danger); }
.link-btn:disabled { color: #d8d2d8; cursor: default; text-decoration: none; }

/* --- Formularios ---------------------------------------------------------- */

.field { margin-bottom: 22px; }

.label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: -.01em;
}

.input, .textarea, .select {
    width: 100%;
    font-family: var(--sans);
    font-size: 16px;
    letter-spacing: -.01em;
    color: var(--ink);
    background: var(--white);
    border: 2px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 15px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--plum);
    box-shadow: 0 0 0 4px var(--plum-wash);
}
.input::placeholder, .textarea::placeholder { color: #bdb8bd; }

.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }

/* Se conservan los nombres antiguos para no tocar cada vista. */
.input-boxed { }
.input-pill  { border-radius: var(--r-pill); padding-left: 20px; padding-right: 20px; }

/* --- Divisor "o" ---------------------------------------------------------- */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--muted);
    font-size: 14px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* --- Tarjetas y avisos ---------------------------------------------------- */

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.alert {
    border-radius: var(--r-md);
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}
.alert-error { background: #fdf3f2; color: var(--danger); border: 1px solid #f2dcda; }
.alert-ok    { background: #f2f7f3; color: var(--ok);     border: 1px solid #dbe8de; }
.alert-info  { background: var(--blush); color: var(--plum-soft); border: 1px solid #f8dde3; }
.alert-warn  { background: #fdf8ee; color: #8a6420; border: 1px solid #f0e2c4; }

.check-list { list-style: none; padding: 0; margin: 18px 0 26px; }
.check-list li { padding: 6px 0 6px 26px; position: relative; font-size: 15px; }
.check-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 15px;
    width: 14px; height: 2px;
    background: var(--gold);
}

/* Variante con icono: la usa la lista de lo que incluye el pago, para que
   coincida con la que ve el cliente en la web antes de entrar. */
.check-list-iconos li { padding-left: 30px; font-weight: 500; }
.check-list-iconos li::before { content: none; }
.check-list-iconos li i {
    position: absolute;
    left: 0; top: 8px;
    width: 18px;
    font-size: 14px;
    text-align: center;
    color: var(--gold);
}

/* --- Marca ---------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;          /* sin hueco bajo la imagen */
}
.brand img {
    /* La altura manda y el ancho se calcula solo: el logo es apaisado y
       fijar el ancho lo deformaría en cuanto cambie el original.
       38px y no menos porque el logo lleva «by Weddify» en un cuerpo muy
       pequeño: por debajo de eso deja de leerse. */
    height: 38px;
    width: auto;
    display: block;
}
.brand:hover img { opacity: .85; }

/* --- Acceso: dos paneles -------------------------------------------------- */

.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

.auth-aside {
    position: relative;
    background: var(--plum);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
/* Sobre el panel morado va el archivo blanco de la marca, que es otro lockup:
   sin el «by Weddify» y más apaisado. Por eso lleva su propia altura — con la
   del otro se vería desproporcionadamente ancho. */
.brand.is-blanco img { height: 34px; }
.auth-aside .brand { line-height: 0; }
.auth-aside h1 {
    color: #fff;
    font-size: clamp(34px, 3.4vw, 52px);
    margin: 0 0 20px;
    position: relative;
}
.auth-aside p { color: rgba(255, 255, 255, .74); font-size: 17px; max-width: 30ch; position: relative; }
.auth-aside .aside-body { position: relative; z-index: 1; }
/* Precio de entrada en el panel de marca: es el argumento, así que se lee
   antes que el resto del párrafo. */
.auth-aside .precio-desde {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .8);
    font-size: 17px;
    max-width: none;
}
.auth-aside .precio-desde b {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 30px;
    color: var(--gold);
    letter-spacing: -.02em;
    vertical-align: -2px;
    margin: 0 2px;
}
.auth-aside .precio-desde span {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, .55);
    margin-top: 2px;
}

.auth-aside .aside-foot { font-size: 14px; color: rgba(255, 255, 255, .5); position: relative; z-index: 1; }

/* Halo de luz cálida, el guiño al oro de la marca. */
.auth-aside::after {
    content: '';
    position: absolute;
    width: 520px; height: 520px;
    right: -180px; bottom: -220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 193, 104, .28) 0%, transparent 68%);
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--white);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card .display { margin-bottom: 6px; }

.auth-foot { text-align: center; margin-top: 26px; font-size: 15px; color: var(--muted); }

.forgot { display: block; text-align: right; font-size: 14px; margin-top: 10px; }

/* Icono grande de las pantallas de recuperación */
.mail-sent-icon {
    font-size: 42px;
    color: var(--gold);
    margin: 0 0 18px;
    line-height: 1;
}
.mail-sent-icon.is-error { color: var(--muted); }

/* El interruptor de "mostrar contraseña" también se usa fuera del editor. */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; color: var(--ink); }
.switch input { width: 17px; height: 17px; accent-color: var(--plum); }

.btn-provider {
    width: 100%;
    min-height: 52px;
    border: 2px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--white);
    font-size: 15px;
    color: var(--ink);
}
.btn-provider:hover { border-color: rgba(52, 22, 53, .3); background: var(--cream); }
.btn-provider svg { width: 18px; height: 18px; }

/* Compatibilidad con la pantalla del instalador y el pago simulado. */
.page-centered {
    background: var(--cream);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
}
.page-centered .auth-card { max-width: 460px; }

/* --- Contenedor general --------------------------------------------------- */

.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 32px 72px;
}

/* Barra superior de la aplicación: la marca vive aquí, no en cada página. */
.app-bar {
    border-bottom: 1px solid var(--line);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 40;
}
.app-bar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.app-bar-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.app-bar-nav a { color: var(--body); padding: 4px 0; border-bottom: 2px solid transparent; }
.app-bar-nav a:hover { color: var(--plum); }
.app-bar-nav a.is-active { color: var(--ink); border-bottom-color: var(--gold); }
.app-bar-nav .soon { color: #c9c4ca; cursor: default; }
.app-bar-nav form { display: inline; }

/* En escritorio los iconos del menú sobran: los enlaces son tres y se leen
   de un vistazo. Solo aparecen en el desplegable móvil, donde ayudan a
   distinguirlos de un golpe. */
.app-bar-nav > a > i, .app-bar-nav > .soon > i { display: none; }

/* El botón de hamburguesa no existe en escritorio. */
.app-bar-burger { display: none; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}
.page-head .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Resumen del dashboard ------------------------------------------------ */

.stat-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 34px;
}
.stat-cell { background: var(--white); padding: 22px 26px; }
.stat-cell b {
    display: block;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 34px;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -.02em;
}
.stat-cell span { font-size: 14px; color: var(--muted); }

/* --- Rejilla de invitaciones ---------------------------------------------- */

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.event-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.event-card:hover {
    border-color: rgba(52, 22, 53, .22);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Miniatura: monograma sobre el color de la plantilla elegida. */
.event-thumb {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 30px;
    letter-spacing: -.02em;
    border-bottom: 1px solid var(--line-soft);
}

.event-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.event-body h2 {
    font-size: 21px;
    margin: 0 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.event-body .meta { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.event-body .card-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    padding: 3px 12px;
    border-radius: var(--r-pill);
    background: var(--plum-wash);
    color: var(--plum-soft);
    white-space: nowrap;
}
/* El punto solo aparece si la etiqueta no trae ya su propio icono. */
.status:not(.has-icon)::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status i { font-size: 11px; }
.status-published { background: #eaf3ec; color: var(--ok); }
.status-pending   { background: var(--gold-wash); color: #a5741f; }

/* Tarjeta de crear, dentro de la misma rejilla. */
.event-create {
    border: 2px dashed var(--line);
    border-radius: var(--r-lg);
    background: var(--cream);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    color: var(--plum);
    transition: border-color .18s ease, background .18s ease;
}
.event-create:hover { border-color: var(--gold); background: var(--blush); }
.event-create .plus {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; line-height: 1;
    color: var(--plum);
}
.event-create span { font-size: 15px; font-weight: 500; }

.empty-state {
    text-align: center;
    padding: 72px 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--cream);
}
.empty-state h2 { font-size: 30px; margin-bottom: 10px; }
.empty-state p { color: var(--muted); margin: 0 auto 28px; max-width: 46ch; }

/* --- Invitados ------------------------------------------------------------ */

.filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.filters .select { width: auto; min-width: 210px; }
.filters-icon { color: var(--muted); font-size: 14px; }

/* Buscador con la lupa dentro del campo. */
.search-field { position: relative; flex: 1; min-width: 260px; }
.search-field i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
}
.search-field .input { padding-left: 42px; }
/* La cruz nativa de Chrome duplicaría el botón de limpiar. */
.search-field .input::-webkit-search-cancel-button { display: none; }

/* Tabla en rejilla: en móvil cada fila se apila sin romperse. */
.guest-table {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--white);
}

.guest-row {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 100px 100px 150px;
    gap: 16px;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-soft);
}
.guest-row:last-child { border-bottom: 0; }
.guest-row:not(.is-head):hover { background: var(--cream); }

.guest-row.is-head {
    background: var(--cream);
    border-bottom-color: var(--line);
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
}

.guest-row b { font-family: var(--serif); font-weight: 500; font-size: 17px; color: var(--ink); }
.guest-row .hint { font-size: 13px; }
.guest-row .hint i { width: 14px; color: #bdb8bd; margin-right: 3px; }
.guest-contact { margin-top: 2px; }
.guest-msg { font-style: italic; margin-top: 2px; }
.guest-count { font-size: 15px; color: var(--ink); }
.guest-count i { color: #bdb8bd; margin-right: 5px; font-size: 13px; }

.ta-c { text-align: center; }
.ta-r { text-align: right; }

/* Las acciones se insinúan en reposo y toman cuerpo al pasar por la fila,
   para que una lista larga no se llene de botones gritando. */
.guest-tools { display: flex; gap: 8px; justify-content: flex-end; }
.guest-tools .icon-btn { opacity: .55; transition: opacity .16s ease, color .16s ease, border-color .16s ease, background .16s ease; }
.guest-row:hover .guest-tools .icon-btn,
.guest-tools .icon-btn:focus-visible { opacity: 1; }

.status-no { background: #fdf1f0; color: var(--danger); }

@media (max-width: 860px) {
    .guest-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 18px; }
    .guest-row.is-head { display: none; }
    .guest-row > :first-child { grid-column: 1 / -1; }
    .ta-c { text-align: left; }
    .guest-tools { justify-content: flex-start; grid-column: 1 / -1; margin-top: 6px; }
}

/* --- Ajustes -------------------------------------------------------------- */

/* Dos columnas: a la izquierda qué es cada ajuste, a la derecha el control.
   Así cada bloque se explica sin necesidad de textos de ayuda flotantes. */
.settings-block {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 34px 0;
    border-bottom: 1px solid var(--line);
}
.settings-block:last-of-type { border-bottom: 0; }

.settings-intro h2 { font-size: 22px; margin: 0 0 8px; }
.settings-intro .hint { margin: 0 0 6px; }

.settings-form { max-width: 420px; }
.settings-form .field:last-of-type { margin-bottom: 24px; }

/* Dato de configuración de OAuth, pensado para copiar y pegar */
.redirect-box {
    margin-top: 22px;
    padding: 16px 18px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.redirect-row { display: flex; align-items: center; gap: 10px; }
.redirect-row code {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    word-break: break-all;
}

/* Cuenta de Google enlazada */
.google-linked { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 15px; }
.google-linked i { color: var(--ok); margin-right: 4px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* Zona de riesgo: se marca con color, no con un borde rojo estridente. */
.settings-block.is-danger .settings-intro h2 { color: var(--danger); }

.btn-danger { border-color: rgba(192, 80, 77, .4); color: var(--danger); }
.btn-danger:not(:disabled):hover { border-color: var(--danger); background: #fdf3f2; }
.btn-primary.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-primary.btn-danger:not(:disabled):hover { background: #a94441; border-color: #a94441; }

@media (max-width: 800px) {
    .settings-block { grid-template-columns: 1fr; gap: 18px; padding: 28px 0; }
    .settings-form { max-width: none; }
}

/* --- Pie ------------------------------------------------------------------ */

.app-foot {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--muted);
}
.app-foot .soon { font-size: 12px; color: #c9c4ca; margin-left: 6px; }

/* --- Modal ---------------------------------------------------------------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(52, 22, 53, .42);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 200;
}
.modal {
    background: var(--white);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 36px 32px;
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
}
.modal h2 { font-size: 30px; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 30px; }

/* --- Selector de plantilla ------------------------------------------------ */

.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.tpl-option {
    border: 2px solid var(--line);
    border-radius: var(--r-md);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    background: var(--white);
    text-align: left;
    transition: border-color .18s ease;
}
.tpl-option:hover { border-color: rgba(52, 22, 53, .3); }
.tpl-option.is-active { border-color: var(--gold); }
.tpl-thumb {
    height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 20px;
    letter-spacing: -.02em;
}
.tpl-option .tpl-name { padding: 12px 14px; font-size: 15px; color: var(--ink); }
.tpl-option .tpl-name small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Ojo para ver la plantilla. La miniatura pasa a ser su contenedor. */
.tpl-thumb { position: relative; }
.tpl-ojo {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px; border-radius: 50%;
    border: 0; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .92); color: var(--plum);
    box-shadow: 0 2px 8px rgba(52, 22, 53, .16);
    opacity: 0; transition: opacity .16s ease, transform .16s ease;
}
.tpl-option:hover .tpl-ojo,
.tpl-option:focus-within .tpl-ojo { opacity: 1; }
.tpl-ojo:hover { transform: scale(1.08); }
/* En pantallas táctiles no hay hover: si se ocultara, sería inalcanzable. */
@media (hover: none) { .tpl-ojo { opacity: 1; } }

/* --- Modal de vista previa de plantilla ----------------------------------- */

.modal-preview {
    max-width: 1040px;
    padding: 24px 24px 20px;
    display: flex; flex-direction: column;
    /* La altura la fija el modal y el iframe se estira dentro: si creciera con
       su contenido, una invitación larga desbordaría la pantalla. */
    height: min(88vh, 860px);
    overflow: hidden;
}
.preview-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.preview-head h2 { font-size: 24px; }
.preview-acciones { display: flex; align-items: center; gap: 10px; }

.preview-device { display: flex; gap: 2px; background: var(--cream); border-radius: 999px; padding: 3px; }
.preview-device button {
    border: 0; background: transparent; cursor: pointer;
    width: 34px; height: 30px; border-radius: 999px;
    color: var(--muted); font-size: 14px;
}
.preview-device button.is-active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(52, 22, 53, .12); }

.preview-lienzo {
    flex: 1; min-height: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--cream);
    border-radius: var(--r-md);
    padding: 16px;
    overflow: hidden;
}
.preview-marco {
    border: 0; background: var(--white);
    box-shadow: 0 8px 30px rgba(52, 22, 53, .16);
    width: 100%; height: 100%;
    /* El ancho lo limita `max-width` en píxeles y nunca se anima: transicionar
       `width` entre un valor en píxeles y un porcentaje deja el iframe clavado
       en el ancho de móvil al pasar a escritorio. */
    transition: border-radius .2s ease;
}
.preview-marco.is-mobile  { max-width: 390px; border-radius: 22px; }
.preview-marco.is-desktop { max-width: none;  border-radius: 8px; }

@media (max-width: 720px) {
    .modal-preview { padding: 18px 16px 16px; height: 92vh; max-width: 100%; }
    .preview-head { margin-bottom: 12px; }
    .preview-head h2 { font-size: 20px; }
    .preview-lienzo { padding: 0; }
    .preview-marco.is-mobile { max-width: none; border-radius: 10px; }
    .modal-preview .modal-actions { margin-top: 16px; }
}

/* --- Utilidades ----------------------------------------------------------- */

.row { display: flex; gap: 14px; }
.row > * { flex: 1; min-width: 0; }
.stack-sm > * + * { margin-top: 10px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-ghost .spinner { border-color: var(--plum-wash); border-top-color: var(--plum); }
@keyframes spin { to { transform: rotate(360deg); } }

[v-cloak] { display: none; }

/* Aviso cuando la interfaz no llega a arrancar: mejor esto que una página
   en blanco sin explicación. */
.app-fallback {
    max-width: 560px;
    margin: 60px auto;
    padding: 0 24px;
    text-align: center;
}

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-aside { padding: 36px 28px; min-height: 240px; }
    .auth-aside .aside-foot { display: none; }
}

@media (max-width: 720px) {
    .shell { padding: 28px 20px 56px; }
    .app-bar-inner { padding: 14px 20px; }
    .brand img { height: 32px; }

    /* Los cuatro elementos del menú no caben en una fila de 375px: medían 415
       y "Salir" quedaba cortado fuera de la pantalla. Se pliegan tras el botón
       de hamburguesa y bajan como panel a lo ancho. */
    .app-bar-burger {
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; margin: -7px -9px -7px 0;   /* 44px: mínimo cómodo para el dedo */
        border-radius: var(--r-md); cursor: pointer;
        color: var(--ink); font-size: 19px;
        -webkit-tap-highlight-color: transparent;
    }
    .app-bar-burger:active { background: var(--cream); }
    .app-bar-burger .fa-xmark { display: none; }
    .app-bar-toggle:checked ~ .app-bar-burger .fa-bars  { display: none; }
    .app-bar-toggle:checked ~ .app-bar-burger .fa-xmark { display: block; }

    .app-bar-nav {
        display: none;
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 6px 0 10px;
        background: var(--white);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 14px 28px rgba(52, 22, 53, .08);
        font-size: 16px;
    }
    .app-bar-toggle:checked ~ .app-bar-nav { display: flex; }

    .app-bar-nav > a, .app-bar-nav > .soon {
        display: flex; align-items: center; gap: 13px;
        padding: 13px 20px; border-bottom: 0;
    }
    /* El activo se marca con una barra lateral: el subrayado inferior de
       escritorio no se distingue cuando los enlaces van apilados. */
    .app-bar-nav > a.is-active {
        color: var(--ink); background: var(--cream);
        box-shadow: inset 3px 0 0 var(--gold);
    }
    .app-bar-nav > a > i, .app-bar-nav > .soon > i {
        display: block; width: 20px; text-align: center; color: var(--muted);
    }
    .app-bar-nav > a.is-active > i { color: var(--gold-deep); }

    .app-bar-nav form { display: block; padding: 10px 20px 2px; }
    .app-bar-nav form .btn { width: 100%; justify-content: center; }
    .page-head { margin-bottom: 26px; }
    .stat-strip { grid-template-columns: 1fr; }
    .tpl-grid { grid-template-columns: 1fr; }
}

/* --- Paleta de colores del editor ---------------------------------------- */

.paleta-grid {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-bottom: 10px;
}
.paleta-celda { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.paleta-celda input[type="color"] {
    width: 46px; height: 46px; padding: 0;
    border: 1px solid var(--line); border-radius: 8px;
    background: none; cursor: pointer;
    overflow: hidden;   /* recorta el relleno a la esquina redondeada */
}
/* Sin esto el navegador dibuja el color en un recuadro pequeno con su propio
   marco, y el cuadro se ve gris en vez de mostrar el color elegido. */
.paleta-celda input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.paleta-celda input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.paleta-celda input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }
.paleta-tools { display: flex; gap: 2px; }
.paleta-tools button {
    border: 0; background: none; cursor: pointer;
    font-size: 12px; line-height: 1; padding: 2px 3px;
    color: var(--muted); border-radius: 4px;
}
.paleta-tools button:hover:not(:disabled) { background: var(--gray-1, rgba(0,0,0,.06)); color: var(--ink); }
.paleta-tools button:disabled { opacity: .3; cursor: default; }
.paleta-tools .danger:hover { color: var(--danger); }

/* ==========================================================================
   Planes: Gratis y EventLine Completa
   --------------------------------------------------------------------------
   Dos piezas y ninguna más: un distintivo para decir en qué plan está una
   invitación, y un bloque para explicar qué hay del otro lado. El editor no
   debe convertirse en un anuncio, así que ambos son deliberadamente sobrios
   —sin colores de alerta, sin insignias grandes— y el oro, que es el acento
   de la marca, se reserva para marcar lo ya comprado.
   ========================================================================== */

.plan-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; line-height: 1.6; white-space: nowrap;
    border: 1px solid var(--line); background: var(--cream); color: var(--muted);
}
.plan-tag.is-completa { border-color: var(--gold); color: var(--gold-deep); background: #fffaf0; }
.plan-tag i { font-size: 11px; }

/* Estado y plan, uno junto al otro en la tarjeta del panel. */
.event-marcas { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* La llamada a mejorar, dentro de la tarjeta de una invitación Gratis. */
.card-upsell { margin: 12px 0 0; }
.card-upsell .link-btn { font-size: 13px; }

/* Aviso de función de pago: se puede seguir editando todo lo demás, así que
   informa sin bloquear. */
.premium-nota {
    border: 1px solid var(--line); border-left: 3px solid var(--gold);
    border-radius: var(--r-md); background: var(--cream);
    padding: 16px 18px; margin: 0 0 22px;
}
.premium-nota p { margin: 0 0 8px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.premium-nota p:last-of-type { margin-bottom: 14px; }
.premium-nota .premium-titulo {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; color: var(--ink); font-weight: 500;
}
.premium-nota .premium-titulo i { color: var(--gold-deep); }

/* Un `hint` que además señala un problema, sin llegar a ser una alerta. */
.hint.is-error { color: var(--danger); }
