/* Web invitation designer (web_pages/show). Normal mode, then designer mode (body.is-designer-mode), then small screens. */
.iw-editor{--iw-bg:#f6f5fa;--iw-card:#fff;--iw-border:#e4e1ec;--iw-accent:#5b3fd6;--iw-accent-dark:#4a31bd;--iw-text:#1f1b2e;--iw-muted:#5f5a70;--iw-soft:#f3f0fd;color:var(--iw-text)}
.ei-app:has(.iw-editor){background:var(--iw-bg)}
.ei-content:has(.iw-editor){max-width:1500px}
.iw-editor h1,.iw-editor h2{color:var(--iw-text)}
.iw-editor h2{font-size:18px;margin:0 0 18px;letter-spacing:-.2px}

/* Buttons: real buttons and links, 44px targets. */
.iw-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:44px;padding:0 18px;border:1px solid var(--iw-border);border-radius:10px;background:#fff;color:var(--iw-text);font:inherit;font-size:15px;font-weight:600;text-decoration:none;cursor:pointer;white-space:nowrap}
.ei-app .iw-btn{color:var(--iw-text);text-decoration:none}
.iw-btn:hover{background:var(--iw-soft)}
.iw-btn:focus-visible,.iw-icon-btn:focus-visible,.iw-segmented button:focus-visible,.iw-add summary:focus-visible{outline:3px solid #c9bdf6;outline-offset:2px}
.iw-btn:disabled{opacity:.55;cursor:default}
.iw-btn svg{width:18px;height:18px;flex-shrink:0}
.iw-btn-primary,.ei-app .iw-btn-primary{background:var(--iw-accent);border-color:var(--iw-accent);color:#fff}
.iw-btn-primary:hover{background:var(--iw-accent-dark)}
.iw-btn-small{min-height:36px;padding:0 12px;font-size:13px}
.iw-btn-danger{color:#b42318}
.ei-app .iw-btn-danger{color:#b42318}

/* Title row and actions. */
.iw-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px 24px;flex-wrap:wrap;margin:0 0 24px}
.iw-title{min-width:0}
.iw-title-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.iw-title h1{font-size:32px;letter-spacing:-.8px;margin:0}
.iw-subtitle{margin:6px 0 0;color:var(--iw-muted);font-size:16px}
.iw-toolbar-actions{display:flex;gap:10px;flex-wrap:wrap}
.iw-exit,.iw-event-name{display:none}

/* Status badge (_design_status). */
.iw-status{display:inline-flex;align-items:center;gap:8px;padding:5px 12px;border-radius:999px;font-size:14px;font-weight:650;white-space:nowrap}
.iw-status-dot{width:8px;height:8px;border-radius:50%;background:currentColor}
.iw-status.is-ok{background:#e5f5eb;color:#17663a}
.iw-status.is-dirty{background:#fff3dc;color:#8a4b00}
.iw-status.is-muted{background:#eeecf3;color:var(--iw-muted)}

/* Workspace: options panel + preview. */
.iw-workspace{display:grid;grid-template-columns:var(--iw-panel,360px) 16px minmax(0,1fr);gap:0 6px;align-items:start}
.iw-card{background:var(--iw-card);border:1px solid var(--iw-border);border-radius:12px;padding:24px}
.iw-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;min-width:0}
.iw-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.iw-muted,.iw-help{color:var(--iw-muted)}
.iw-help{font-size:13px;line-height:1.5;margin:8px 0 0}
.iw-card-head+.iw-help{margin:-8px 0 14px}

/* Fields with associated labels. */
.iw-field{margin:0 0 18px;min-width:0;border:0;padding:0}
.iw-field:last-child{margin-bottom:0}
.iw-field>label,.iw-field>legend,.iw-label{display:block;margin:0 0 8px;color:var(--iw-muted);font-size:14px;font-weight:600;padding:0}
.ei-app .iw-editor select,.ei-app .iw-editor input[type=text],.ei-app .iw-editor input[type=url],.ei-app .iw-editor input[type=date],.ei-app .iw-editor input[type=number],.ei-app .iw-editor textarea{width:100%;min-height:44px;padding:0 14px;border:1px solid #d6d2e0;border-radius:10px;background:#fff;color:var(--iw-text);font:inherit;font-size:15px}
.ei-app .iw-editor textarea{padding:10px 14px;resize:vertical;line-height:1.5}
.ei-app .iw-editor input[type=color]{width:100%;height:44px;padding:4px;border:1px solid #d6d2e0;border-radius:10px;background:#fff;cursor:pointer}
.ei-app .iw-editor select:focus,.ei-app .iw-editor input:focus,.ei-app .iw-editor textarea:focus{outline:3px solid #ddd4fb;border-color:var(--iw-accent)}
.iw-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.iw-row .iw-field{margin-bottom:18px}

/* Background color swatches (styled radios). */
.iw-swatch-list{display:flex;gap:6px;flex-wrap:wrap}
.iw-swatch{position:relative;display:grid;place-items:center;width:46px;height:46px;cursor:pointer}
.iw-swatch input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}
.iw-swatch span{width:38px;height:38px;border-radius:50%;border:1px solid #0000001f;transition:box-shadow .12s}
.iw-swatch:hover span{box-shadow:0 0 0 3px #fff,0 0 0 5px #cfc6f3}
.iw-swatch input:checked+span{box-shadow:0 0 0 3px #fff,0 0 0 5px var(--iw-accent)}
.iw-swatch input:focus-visible+span{outline:3px solid #c9bdf6;outline-offset:6px}

/* Image drop zone (visually hidden but focusable input). */
.iw-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.iw-dropzone{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:10px 14px;border:1.5px dashed #cdc6dd;border-radius:10px;background:#faf9fd;color:var(--iw-accent);font-weight:600;cursor:pointer}
.iw-dropzone svg{width:18px;height:18px}
.iw-dropzone:hover,.iw-dropzone.is-over{border-color:var(--iw-accent);background:var(--iw-soft)}
.iw-file:focus-visible+.iw-dropzone{outline:3px solid #c9bdf6;outline-offset:2px}
.iw-image-current{display:flex;align-items:center;gap:12px;padding:8px;border:1px solid var(--iw-border);border-radius:10px}
.iw-image-current img{width:56px;height:42px;object-fit:cover;border-radius:6px}
.iw-image-current span{flex:1;font-size:14px;color:var(--iw-muted)}

/* Sections list. */
.iw-section-list{list-style:none;margin:0 0 12px;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.iw-section-item{border:1px solid var(--iw-border);border-radius:10px;background:#fff}
.iw-section-item.is-open{border-color:var(--iw-accent);background:#faf8ff}
.iw-section-item.is-hidden .iw-section-name>span{color:var(--iw-muted)}
.iw-section-item.is-dragging{opacity:.5;border-style:dashed}
.iw-section-row{display:flex;align-items:center;gap:10px;min-height:54px;padding:0 6px 0 10px}
.iw-grip{display:grid;place-items:center;width:24px;height:36px;color:#8a85a0;cursor:grab;touch-action:none}
.iw-grip svg{width:16px;height:16px}
.iw-section-name{flex:1;min-width:0;display:flex;align-items:center;gap:8px;font-weight:600}
.iw-section-name>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iw-tag{font-size:11px;font-weight:650;padding:2px 8px;border-radius:999px;background:#eeecf3;color:var(--iw-muted)}
.iw-icon-btn{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:8px;background:transparent;color:var(--iw-muted);cursor:pointer}
.iw-icon-btn:hover,.iw-icon-btn[aria-expanded=true]{background:var(--iw-soft);color:var(--iw-accent)}
.iw-icon-btn svg{width:18px;height:18px}
.iw-section-editor{padding:14px 14px 16px;border-top:1px solid var(--iw-border)}
.iw-section-fields .iw-field{margin-bottom:14px}
.iw-item{padding:12px;border:1px dashed var(--iw-border);border-radius:10px;margin:0 0 12px}
.iw-section-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid var(--iw-border)}
.iw-add summary{display:flex;align-items:center;justify-content:center;min-height:48px;border:1px solid var(--iw-border);border-radius:10px;color:var(--iw-accent);font-weight:650;cursor:pointer;list-style:none}
.iw-add summary::-webkit-details-marker{display:none}
.iw-add summary:hover,.iw-add[open] summary{background:var(--iw-soft)}
.iw-add-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.iw-add-options .iw-btn{white-space:normal;min-height:44px;font-size:14px;padding:6px 10px}

/* Preview. */
.iw-preview{padding:0;overflow:hidden;min-width:0}
.iw-preview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 20px 14px 24px;border-bottom:1px solid var(--iw-border)}
.iw-preview-head h2{margin:0}
.iw-segmented{display:inline-flex;gap:4px;padding:4px;border-radius:10px;background:#efedf4}
.iw-segmented button{min-height:36px;min-width:44px;padding:0 16px;border:0;border-radius:8px;background:transparent;color:var(--iw-muted);font:inherit;font-weight:600;cursor:pointer}
.iw-segmented button[aria-pressed=true]{background:#fff;color:var(--iw-accent);box-shadow:0 1px 3px #1f1b2e1f}
.iw-canvas{padding:28px;background:#ecebf1}
.iw-frame{margin:0 auto;padding:10px;background:#fff;border-radius:16px;box-shadow:0 4px 18px #1f1b2e14;transition:max-width .2s}
.iw-frame iframe{display:block;width:100%;height:max(560px,calc(100vh - 330px));border:0;border-radius:8px;background:#fff}
.iw-canvas.is-mobile .iw-frame{max-width:380px;border-radius:28px}
.iw-canvas.is-mobile .iw-frame iframe{border-radius:20px}

/* Toast. */
.iw-toast{position:fixed;right:24px;bottom:24px;z-index:1000;max-width:min(440px,calc(100vw - 32px));padding:14px 18px;border-radius:10px;background:var(--iw-text);color:#fff;font-size:14px;box-shadow:0 10px 30px #1f1b2e40}
.iw-toast.is-error{background:#b42318}
.iw-toast[hidden]{display:none}

/* ---------- Designer mode: same markup, full window ---------- */
body.is-designer-mode{background:#ecebf1}
body.is-designer-mode .ei-sidebar,body.is-designer-mode .ei-topbar,body.is-designer-mode .ei-content>.ei-notice{display:none}
body.is-designer-mode .ei-main{margin-left:0!important}
body.is-designer-mode .ei-content{max-width:none;padding:0}
body.is-designer-mode .ei-steps,body.is-designer-mode .iw-title h1,body.is-designer-mode .iw-subtitle,body.is-designer-mode .iw-enter{display:none}
body.is-designer-mode .iw-toolbar{position:sticky;top:0;z-index:50;flex-wrap:nowrap;height:60px;margin:0;padding:0 16px;background:#1f1b2e;color:#fff}
body.is-designer-mode .iw-exit,body.is-designer-mode .iw-event-name{display:inline-flex}
body.is-designer-mode .iw-exit{order:-1}
body.is-designer-mode .iw-title{flex:1}
body.is-designer-mode .iw-event-name{font-size:17px;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.is-designer-mode .iw-toolbar .iw-btn:not(.iw-btn-primary){background:transparent;border-color:#ffffff40;color:#fff}
body.is-designer-mode .iw-toolbar .iw-btn:not(.iw-btn-primary):hover{background:#ffffff14}
body.is-designer-mode .iw-toolbar .iw-btn-primary{background:#6e56e8;border-color:#6e56e8}
body.is-designer-mode .iw-toolbar .iw-btn-primary:hover{background:#5b3fd6}
body.is-designer-mode .iw-status{background:transparent;padding:0}
body.is-designer-mode .iw-status.is-ok{color:#86e0a6}
body.is-designer-mode .iw-status.is-dirty{color:#ffc764}
body.is-designer-mode .iw-status.is-muted{color:#d2cde0}
body.is-designer-mode .iw-workspace{grid-template-columns:var(--iw-panel,320px) 16px minmax(0,1fr);gap:0 4px;height:calc(100vh - 60px);padding:20px}
body.is-designer-mode .iw-controls{height:100%;overflow:auto;align-content:start;padding-right:4px}
body.is-designer-mode .iw-preview{height:100%;display:flex;flex-direction:column}
body.is-designer-mode .iw-canvas{flex:1;overflow:auto}
body.is-designer-mode .iw-frame iframe{height:calc(100vh - 220px)}

/* ---------- Small screens: panel and preview stack ---------- */
@media(max-width:960px){
  .iw-workspace,body.is-designer-mode .iw-workspace{grid-template-columns:1fr;gap:20px;height:auto}
  .iw-resizer{display:none}
  body.is-designer-mode .iw-controls{height:auto;overflow:visible}
  .iw-frame iframe,body.is-designer-mode .iw-frame iframe{height:620px}
}
@media(max-width:680px){
  .iw-title h1{font-size:26px}
  .iw-toolbar-actions{width:100%}
  .iw-toolbar-actions .iw-btn{flex:1 1 auto}
  .iw-card{padding:18px}
  .iw-canvas{padding:14px}
  body.is-designer-mode .iw-toolbar{height:auto;min-height:60px;flex-wrap:wrap;padding:8px 12px}
  body.is-designer-mode .iw-exit span,body.is-designer-mode .iw-toolbar [data-clipboard] span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  body.is-designer-mode .iw-workspace{padding:12px}
}

/* The module stylesheet styles every label and input (.ei-app label/input); undo it for the editor's own controls. */
.ei-app .iw-editor label{margin:0;font-weight:inherit}
.ei-app .iw-editor .iw-field>label:not(.iw-dropzone){display:block;margin:0 0 8px;font-weight:600}
.ei-app .iw-editor .iw-swatch{display:grid}
.ei-app .iw-editor .iw-swatch input{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;margin:0;opacity:0}
.ei-app .iw-editor .iw-dropzone{display:flex;font-weight:600}
.ei-app .iw-editor .iw-file{width:1px;height:1px;padding:0;border:0;margin:0}
.ei-app .iw-editor .iw-swatch input:focus,.ei-app .iw-editor .iw-file:focus{outline:0}
body.is-designer-mode .iw-event-name{min-width:6em;flex:0 1 auto}
@media(min-width:961px){body.is-designer-mode .iw-title-row{flex-wrap:nowrap;min-width:0}}

/* Panel resizer (invitation_resizer.js): a 16px column between panel and preview, full height. */
.iw-resizer{align-self:stretch;position:relative;display:flex;justify-content:center;min-height:120px;cursor:col-resize;touch-action:none;border-radius:8px}
.iw-resizer span{position:sticky;top:45vh;width:4px;height:48px;margin-top:40px;border-radius:4px;background:#cfcadb;transition:background .15s,height .15s}
.iw-resizer:hover span,.iw-resizer:focus-visible span,.is-resizing .iw-resizer span{background:var(--iw-accent);height:72px}
.iw-resizer:focus-visible{outline:3px solid #c9bdf6;outline-offset:-2px}
.iw-workspace.is-resizing{cursor:col-resize;user-select:none}
.iw-workspace.is-resizing iframe{pointer-events:none}
body.is-designer-mode .iw-resizer{height:100%}

/* "Continuar al siguiente paso": outlined accent once the invitation is saved; muted until then. */
.ei-app .iw-btn-next{border-color:var(--iw-accent);color:var(--iw-accent)}
.ei-app .iw-btn-next:disabled{border-color:var(--iw-border);color:var(--iw-muted);background:#fff;opacity:1}
body.is-designer-mode .iw-toolbar .iw-btn-next:not(:disabled){border-color:#b9acf5;color:#fff}
body.is-designer-mode .iw-toolbar .iw-btn-next:disabled{background:transparent;color:#a9a3ba;border-color:#ffffff26}
