/*
 * Client area, support pages: tickets, knowledge base, announcements and downloads (supportticket*.tpl, viewticket.tpl,
 * ticketfeedback.tpl, knowledgebase*.tpl, announcements.tpl, viewannouncement.tpl, downloads*.tpl, downloaddenied.tpl).
 * Only what area.css (Diseño, piezas/whmcs-area) does not have; same names, colours and spacing.
 */

/* ---------- public pages (knowledge base, announcements, downloads, a ticket opened from its e-mail link):
   the same page without the side menu ---------- */
.area.area-suelta { grid-template-columns: minmax(0, 1fr); max-width: 1080px; }

/* the theme's global element rules that reach inside the area: "article" (margins of the site's text pages) and
   "header" (the fixed site bar, which the <header> of each message in a ticket would otherwise become) */
:where(.area) article { margin: 0; padding-left: 0; padding-right: 0; max-width: none; }
.area-burbuja header { position: static; width: auto; height: auto; padding: 0; background: none; box-shadow: none; z-index: auto; cursor: auto; }

/* hidden but read by screen readers */
.area-oculto { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- notices: errors and confirmations, next to the amber and blue ones of area.css ---------- */
.area-aviso.rojo { background: #fdf0ef; border-left: 4px solid #d01c2a; color: #5c1410; }
.area-aviso.verde { background: #edf7f1; border-left: 4px solid #2e9d5b; color: #17442a; }
.area-aviso ul { flex: 1 1 100%; margin: 0; padding-left: 1.2em; }
.area-aviso ul > li { list-style: disc; margin: .15em 0; }
.area-aviso a { color: inherit; font-weight: bold; }

/* ---------- small pieces ---------- */
.area-datos.una { grid-template-columns: minmax(0, 1fr); }
.area-campo > .etiqueta span { font-weight: normal; color: var(--gris); }
.area textarea.alto { min-height: 11em; }
.area-seccion .area-soltar { margin-top: .9em; }
.area-rejilla .area-soltar { margin-top: 0; }
.area-categoria small b { display: inline; color: var(--texto); }
.area-enlaces a > span { min-width: 0; }
.area-enlaces a > span small { display: block; white-space: normal; margin-top: .15em; font-size: .85em; line-height: 1.45; }
.area-enlaces a:focus-visible, .area-categoria:focus-visible, .area-anuncio a:focus-visible, .area-fila a:focus-visible, .area-miga a:focus-visible,
.area-paginas a:focus-visible, .area-util a:focus-visible, .area-texto a:focus-visible, .area-adjunto:focus-visible, .area-enlace-gris:focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.area-enlaces a:focus-visible { outline-offset: -3px; }
.area-separada { margin-top: 1.5em; }
.area-etiquetas { display: flex; flex-wrap: wrap; gap: .4em; margin: 1.2em 0 0; padding: 0; list-style: none; font-size: .85em; }
.area-articulo .area-etiquetas { margin: 1.2em 0 0; padding: 0; } /* beats area.css's .area-articulo ul */
.area-articulo .area-etiquetas > li { list-style: none; margin: 0; }
.area-etiquetas a { display: inline-block; padding: .25em .7em; border-radius: 1em; background: var(--fondo); border: 1px solid var(--linea); color: var(--tinta); text-decoration: none; }
.area-etiquetas a:hover { border-color: var(--borde); color: var(--tinta); }
.area-paginas .desactivada { background: none; color: var(--gris); font-weight: normal; }
.area-paginas a { color: var(--tinta); }
.area-pie-lista .area-paginas { margin-left: auto; }

/* ---------- lists: tickets and downloads (rows like the invoices; on phones each row is a card) ---------- */
/* tickets: subject, number and department | last reply | status | action */
.area-lista.tickets .area-fila { grid-template-columns: minmax(0, 2.6fr) 1fr 9.5em 4.5em; }
/* downloads: name and description | size | action */
.area-lista.descargas .area-fila { grid-template-columns: minmax(0, 3fr) 6em 7.5em; }
.area-fila .peso { color: var(--texto); font-size: .9em; white-space: nowrap; text-align: right; }
.area-fila .que .area-estado { margin-left: .4em; vertical-align: .1em; }
/* a ticket with a reply the client has not read: dot before the subject and the subject in the link colour */
.area-fila.sin-leer .que b::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .45em; border-radius: 50%; background: var(--primary-color); vertical-align: .12em; }
.area-fila.sin-leer .que b { color: var(--dark-primary-color); }
.area-fila[data-href] { cursor: pointer; }
.area-fila[data-href]:hover .que b { text-decoration: underline; }
.area-fila .que a { color: inherit; text-decoration: none; }
.area-fila .que a:hover b { text-decoration: underline; }

/* ---------- a ticket: what WHMCS gives as the message (HTML from markdown or from an e-mail) ---------- */
.area-texto { overflow-wrap: anywhere; }
.area-texto img { max-width: 100%; height: auto; }
.area-texto :is(ul, ol) { margin: 0 0 .7em; padding-left: 1.4em; }
.area-texto ul > li { list-style: disc; }
.area-texto ol > li { list-style: decimal; }
.area-texto blockquote { margin: 0 0 .7em; padding: .1em 0 .1em .9em; border-left: 3px solid var(--borde); color: var(--texto); }
.area-texto pre { white-space: pre-wrap; margin: 0 0 .7em; font-size: .9em; }
.area-texto :is(h1, h2, h3, h4) { font-size: 1em; margin: 0 0 .5em; color: var(--tinta); }
.area-texto table { display: block; max-width: 100%; overflow-x: auto; }
.area-burbuja .ip { margin: .8em 0 0; font-size: .8em; color: var(--gris); }
.area-adjunto.borrado { color: var(--gris); }
.area-adjuntos-titulo { margin: .9em 0 0; font-size: .8em; color: var(--gris); }

/* rating of one of our replies: five stars, links that the server records (viewticket.php?rating=...) */
.area-valorar { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .8em; margin-top: .9em; padding-top: .8em; border-top: 1px solid var(--linea); font-size: .85em; color: var(--texto); }
.area-estrellas { display: inline-flex; flex-direction: row-reverse; gap: .1em; }
.area-estrellas a, .area-estrellas span { display: inline-block; width: 2.2em; height: 2.2em; border-radius: .3em; background: #6b7785;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.8 6.3.9-4.6 4.4 1.1 6.3L12 17.2l-5.6 3 1.1-6.3-4.6-4.4 6.3-.9z' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.8 6.3.9-4.6 4.4 1.1 6.3L12 17.2l-5.6 3 1.1-6.3-4.6-4.4 6.3-.9z' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; }
/* filled: the given rating, or the star under the pointer and the ones before it (row-reverse: "before" is after in the DOM) */
.area-estrellas .llena, .area-estrellas a:hover, .area-estrellas a:hover ~ a, .area-estrellas a:focus-visible, .area-estrellas a:focus-visible ~ a {
  background: #9a6700;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.8 6.3.9-4.6 4.4 1.1 6.3L12 17.2l-5.6 3 1.1-6.3-4.6-4.4 6.3-.9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.8 6.3.9-4.6 4.4 1.1 6.3L12 17.2l-5.6 3 1.1-6.3-4.6-4.4 6.3-.9z'/%3E%3C/svg%3E"); }
.area-estrellas a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }

/* attachments chosen for a reply or a new ticket, before sending: pills with a button to take one out */
.area-elegidos { display: flex; flex-wrap: wrap; gap: .5em; margin: .8em 0 0; padding: 0; list-style: none; }
.area-elegidos:empty { display: none; }
.area-elegidos .area-adjunto { padding-right: .3em; }
.area-elegidos .area-adjunto.mal { border-color: #d01c2a; color: #b3261e; }
.area-elegidos button { display: inline-flex; align-items: center; justify-content: center; width: 2em; height: 2em; border: 0; border-radius: 50%; background: none;
  color: var(--gris); font: inherit; font-size: 1.1em; line-height: 1; cursor: pointer; }
.area-elegidos button:hover { background: var(--fondo); color: var(--tinta); }
.area-elegidos button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 0; }
.area-soltar.encima { border-color: var(--primary-color); background: var(--fondo); }
.area-soltar input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.area-soltar:has(input[type=file]:focus-visible) .area-boton-sec { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
/* scrolled to after a failed send: clear of the fixed site bar */
[data-area-error], [data-area-envio] { scroll-margin-top: 6em; }
.area-error-campo { margin: .5em 0 0; color: #b3261e; font-size: .85em; }

/* custom fields of a department: they join the grid of the form */
.area-campos-extra { display: contents; }

/* ---------- new ticket ---------- */
.area-categorias.dos { grid-template-columns: repeat(2, 1fr); }
.area-opciones.dos { grid-template-columns: repeat(2, 1fr); }
.area-captcha { padding: 0 1.5em 1.2em; }
.area-captcha .captcha { margin: 0; }

/* ---------- ticket feedback: a scale from 1 to 10 for each person who answered ---------- */
.area-escala { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin: 0; padding: 0; border: 0; }
.area-escala legend { width: 100%; margin-bottom: .5em; padding: 0; font-weight: bold; font-size: .9em; color: var(--tinta); }
.area-escala label { position: relative; }
.area-escala input { position: absolute; opacity: 0; }
.area-escala label span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75em; height: 2.75em; border: 2px solid #6b8ca6;
  border-radius: .45em; background: #fff; color: var(--tinta); font-weight: bold; cursor: pointer; }
.area-escala input:checked + span { border-color: var(--primary-color); background: var(--fondo); color: var(--dark-primary-color); }
.area-escala input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus-ring); }
.area-escala small { color: var(--gris); font-size: .82em; }

/* ---------- knowledge base ---------- */
/* categories in rows of four, the last row centred (7 = 4 + 3), as "Qué hacemos hoy" (.pag-servicios in paginas.css) */
.area-categorias.centradas { display: flex; flex-wrap: wrap; justify-content: center; }
.area-categorias.centradas > * { flex: 0 1 calc((100% - 3em) / 4); box-sizing: border-box; min-width: 0; }
.area-categorias.centradas > .area-categoria { flex-direction: column; align-items: center; gap: .7em; text-align: center; }
.area-util form { display: contents; }
.area-util .derecha { margin-left: auto; }
.area-articulo ol > li { list-style: decimal; }
.area-articulo ul > li { list-style: disc; }
.area-articulo :is(ol, ul) { padding-left: 1.4em; }
.area-articulo img { max-width: 100%; height: auto; }
.area-articulo table { display: block; max-width: 100%; overflow-x: auto; }
.area-articulo { overflow-wrap: anywhere; }

/* ---------- announcements ---------- */
.area-anuncio .area-texto > :last-child { margin-bottom: 0; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .area-lista.tickets .area-fila, .area-lista.descargas .area-fila { grid-template-columns: minmax(0, 1fr) auto; gap: .5em 1em; padding: 1.1em 1.2em; }
  .area-lista.descargas .area-fila .peso { grid-column: 2; grid-row: 1; }
  .area-opciones.dos, .area-categorias.dos { grid-template-columns: 1fr; }
  .area-categorias.centradas > * { flex-basis: 100%; }
  .area-categorias.centradas > .area-categoria { flex-direction: row; align-items: flex-start; gap: .9em; text-align: left; }
  .area-estrellas a { width: 2.9em; height: 2.9em; }
  .area-valorar { gap: .4em .8em; }
}
@media print {
  .area-menu, .area-cabecera .acciones, .area-util, body > header, body > footer, .copyright { display: none !important; }
  .area { display: block; padding: 0; }
  .area-tarjeta { box-shadow: none; }
}
