
/* struture */

.form-preview-wrap {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.preview {
    padding-left: 0;
}

@media (min-width: 1020px) {
    .form-preview-wrap {
        flex-direction: row;
    }
    .form-preview-wrap,
    .preview {
        flex-grow: 0;
        flex-shrink: 0;
    }
    .form-preview-wrap .form {
        flex-basis:40%;
    }
    /* columns keep their share; content wraps instead of widening them */
    .form-preview-wrap .form,
    .form-preview-wrap .preview {
        min-width: 0;
    }
    .preview {
        flex-basis: 55%;
        padding-left: 32px;
        padding-top: 0;
    }
}

.btn-msg-wrap {
    align-items: center;
    display: flex;
    /* buttons + notices must wrap, or a long notice widens the column (#19) */
    flex-wrap: wrap;
    row-gap: 8px;
}

.group:not(:first-of-type) {
    margin-top: 12px;
}

.title {
    margin-bottom: 14px;
}

.form-to-copy-wrap {
    margin-top: 18px
}

textarea {
    width: 100%;
}

.msg {
    color: #004e00;
    padding-left: 12px;
    font-weight: 510;
}

/* button */

button.heg-button {
    min-width: 122px;
}

button.heg-button.narrow {
    min-width: 62px;
}

.heg-button {

    /* Reset básico */
    all: unset;
  
    /* Display y caja */
    display: inline-block;
    padding: 0.75em 1.5em;
    border: 2px solid #0077cc;
    border-radius: 6px;
    background-color: #0077cc;
    color: #fff;
    font-size: 1rem;
    font-family: sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  
    /* Transiciones */
    transition: background-color 0.3s, border-color 0.3s, transform 0.1s, box-shadow 0.3s;
  
    /* Sombra */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.heg-button:not(:first-of-type) {
    margin-left: 12px;
}

/* utility classes */
.hidden {
    display: none;
}
  
/* Hover */
.heg-button:hover {
    background-color: #005fa3;
    border-color: #005fa3;
}
  
/* Focus */
.heg-button:focus {
    outline: 3px solid #80bfff;
    outline-offset: 2px;
}
 
/* Active (al hacer clic) */
.heg-button:active {
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* language selector */
.lang-btn {
  background: none;
  border: none;
  color: inherit;
  padding: 0 4px;
  cursor: pointer;
  text-decoration: none;
}
.lang-btn:hover {
    text-decoration: underline;
}

.lang-btn.active {
  color: #0000EE;
  font-weight: bold;
  text-decoration: none;
}

.language-links {
  font-size: 0.9rem;
  display: inline-block;
}


/* lists style to display message preview correctly */
ul {
    padding-left: 40px;
    list-style-type: disc;
    margin-bottom: 8px;
}
ol {
    margin-top: 0px;
}

.help  {
    max-width: 620px;
}

ul.help {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.help li {
  position: relative;
  padding-left: 1.5em; /* Espacio para el símbolo */
  margin-bottom: 0.5em;
}

ul.help li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: green; /* Puedes ajustar el color */
  font-weight: bold;
}

#template-search {
    max-width: 120px;
}
/* toolbar: rows of buttons must not touch */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* personal templates (#10) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.template-picker {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 6px;
}

#template-select {
    width: 300px;
    max-width: 100%;
}

.template-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.template-actions button {
    text-align: left;
}

button.danger {
    color: #a31515;
}

.template-transfer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    font-size: 0.85rem;
}

.template-transfer .hint {
    color: #555;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: #0057a8;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.link-button:hover {
    color: #003d75;
}

.label-short {
    display: none;
}

.msg.msg-warning {
    color: #8a4b00;
}

/* without storage: hide what needs it (save, delete, import) */
.no-storage .needs-storage,
.no-storage #delete-template-button {
    display: none !important;
}

@media (max-width: 1019px) {
    .template-picker {
        flex-direction: column;
        align-items: stretch;
    }
    #template-select {
        width: 100%;
        font-size: 16px;
        padding: 8px;
    }
    .template-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .template-actions button {
        min-height: 44px;
        text-align: center;
    }
    .label-long {
        display: none;
    }
    .label-short {
        display: inline;
    }
    .template-transfer .hint {
        display: none;
    }
    .template-transfer .link-button {
        padding: 10px 0;
    }
}

/* preview drawn as the message window of an email client (#18) */
.mail-window {
    border: 1px solid #c8c8c8;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mail-window-bar {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ececec;
    border-bottom: 1px solid #d6d6d6;
    font-size: 0.9rem;
    color: #333;
}

.mail-window-subject {
    grid-column: 2;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-window-subject em {
    font-weight: normal;
    color: #666;
}

/* decorative: it only suggests a window, it does nothing */
.mail-window-close {
    grid-column: 3;
    justify-self: end;
    font-size: 1.2rem;
    line-height: 1;
    color: #777;
    cursor: default;
    user-select: none;
}

.mail-window-body {
    padding: 24px 30px;
}

/* same rule the copied email carries in its <head> */
@media (pointer: coarse) {
    .mail-window-body .tel-enllac {
        text-decoration: underline;
    }
}

/* message language and templates: collapsible box (#19) */
.settings-panel {
    border: 1px solid #c8c8c8;
    border-radius: 8px;
    padding: 10px 14px 14px;
}

.settings-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.settings-panel-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.settings-panel-summary {
    font-weight: normal;
    color: #555;
}

.settings-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    color: #333;
    cursor: pointer;
}

.settings-panel-toggle:hover {
    background: #f0f0f0;
    border-color: #d6d6d6;
}

.settings-panel-toggle:focus-visible {
    outline: 3px solid #80bfff;
    outline-offset: 1px;
}

.settings-panel-toggle svg {
    transition: transform 0.2s;
}

.settings-panel-toggle[aria-expanded="false"] svg {
    transform: rotate(180deg);
}

.settings-panel-body {
    margin-top: 8px;
}

.settings-panel.collapsed {
    padding-bottom: 10px;
}

@media (max-width: 1019px) {
    .settings-panel-toggle {
        width: 44px;
        height: 44px;
    }
}

.settings-panel {
    margin-bottom: 12px;
}

.template-actions button {
    white-space: nowrap;
}

@media (min-width: 1020px) {
    /* the list takes what's left beside the buttons */
    #template-select {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }
}

/* wrapped rows: spacing by gap, not by a left margin that misaligns them */
.btn-msg-wrap {
    column-gap: 12px;
}

.btn-msg-wrap .heg-button:not(:first-of-type) {
    margin-left: 0;
}

.btn-msg-wrap .msg:empty {
    display: none;
}
