/*
 * IBV Client: pantallas del portal (login, registro, perfil, consultas y avisos).
 *
 * Todo cuelga de .ibvc (el contenedor de cada shortcode, ver FrontStyles) y hereda el color del
 * texto: funciona igual sobre fondo blanco que en las columnas oscuras de WPBakery. Colores de
 * ergoibv.com: azul marino #080C27 y azul #6194BF; tipografía Lato. Para otro portal, cambiar las
 * variables de .ibvc o añadir CSS con el filtro ibvc_form_css.
 */

.ibvc {
	--ibvc-accent: #6194bf;
	--ibvc-ink: #080c27;
	--ibvc-line: rgba(128, 128, 128, 0.35);
	--ibvc-soft: rgba(128, 128, 128, 0.08);
	--ibvc-danger: #e5484d;
	--ibvc-radius: 6px;
	clear: both;
	text-align: left;
	font-family: Lato, sans-serif;
	letter-spacing: 0.3px;
	line-height: 1.5;
}

.ibvc::after {
	content: "";
	display: table;
	clear: both;
}

.ibvc p,
.ibvc li,
.ibvc strong,
.ibvc b,
.ibvc p strong,
.ibvc li strong,
.ibvc dt,
.ibvc dd,
.ibvc h3,
.ibvc h4 {
	color: inherit;
}

.ibvc h3 {
	margin: 0 0 0.8em;
	font-size: 1.5em;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.5px;
}

.ibvc p {
	margin: 0 0 1em;
}

/* El tema hace flotar listas, tablas y listas de definición, y da ancho fijo a los títulos. */
.ibvc ul,
.ibvc ol,
.ibvc li,
.ibvc table,
.ibvc h3 {
	float: none;
	width: auto;
}

.ibvc dl dt,
.ibvc dl dd {
	float: none;
	color: inherit;
	width: auto;
	min-height: 0;
	margin-bottom: 0;
}

.ibvc a:not(.ibvc-button) {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: rgba(128, 128, 128, 0.6);
	text-underline-offset: 3px;
	transition: color 0.15s, text-decoration-color 0.15s;
}

.ibvc a:not(.ibvc-button):hover,
.ibvc a:not(.ibvc-button):focus {
	color: var(--ibvc-accent);
	text-decoration-color: currentColor;
}

/* Formularios */

.ibvc-form {
	margin: 0 0 1.5em;
}

.ibvc .ibvc-field {
	margin: 0 0 1.1em;
}

.ibvc label {
	display: block;
	margin: 0 0 0.35em;
	color: inherit;
	font-size: 0.9em;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-align: left;
}

.ibvc .ibvc-field-checkbox label,
.ibvc label:has(> input[type="checkbox"]) {
	display: flex;
	align-items: center;
	gap: 0.5em;
	font-weight: 400;
}

.ibvc input[type="text"],
.ibvc input[type="email"],
.ibvc input[type="password"],
.ibvc input[type="tel"],
.ibvc input[type="number"],
.ibvc input[type="date"],
.ibvc input[type="url"],
.ibvc input[type="search"],
.ibvc select,
.ibvc textarea {
	box-sizing: border-box;
	width: 100%;
	height: auto;
	min-height: 44px;
	margin: 0;
	padding: 0.6em 0.85em;
	border: 1px solid #c5cad6;
	border-radius: var(--ibvc-radius);
	background: #fff;
	box-shadow: none;
	color: var(--ibvc-ink);
	font-family: inherit;
	font-size: 15px;
	letter-spacing: normal;
	line-height: 1.4;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.ibvc textarea {
	min-height: 9em;
	resize: vertical;
}

.ibvc input:focus,
.ibvc select:focus,
.ibvc textarea:focus {
	border-color: var(--ibvc-accent);
	outline: none;
	box-shadow: 0 0 0 3px rgba(97, 148, 191, 0.35);
}

.ibvc input[type="checkbox"] {
	width: 1.1em;
	height: 1.1em;
	margin: 0;
	accent-color: var(--ibvc-accent);
}

.ibvc input[type="file"] {
	max-width: 100%;
	color: inherit;
	font-family: inherit;
	font-size: 0.9em;
}

.ibvc input[type="file"]::file-selector-button {
	margin-right: 0.8em;
	padding: 0.5em 1.1em;
	border: 1px solid currentColor;
	border-radius: 50px;
	background: transparent;
	color: inherit;
	font-family: inherit;
	cursor: pointer;
}

.ibvc .ibvc-required,
.ibvc .ibvc-error {
	color: var(--ibvc-danger);
}

.ibvc .ibvc-error {
	display: block;
	margin-top: 0.3em;
	font-size: 0.85em;
}

.ibvc .ibvc-has-error input,
.ibvc .ibvc-has-error select,
.ibvc .ibvc-has-error textarea {
	border-color: var(--ibvc-danger);
}

.ibvc .ibvc-help {
	display: block;
	margin-top: 0.3em;
	font-size: 0.85em;
	opacity: 0.8;
}

/*
 * Campos con icono delante (login), como el de WP-Client en ergoibv.com: icono de 30 px a la
 * izquierda y el nombre del campo dentro; la etiqueta solo para lectores de pantalla.
 */
.ibvc .ibvc-field-icon {
	position: relative;
	padding-left: 48px;
}

.ibvc .ibvc-field-icon::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 0;
	width: 30px;
	height: 30px;
	background: no-repeat center / contain;
}

.ibvc .ibvc-icon-user::before {
	background-image: url("../img/user.png");
}

.ibvc .ibvc-icon-lock::before {
	background-image: url("../img/lock.png");
}

.ibvc .ibvc-field-icon label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ibvc input::placeholder,
.ibvc textarea::placeholder {
	color: #8a8f9c;
	opacity: 1;
}

/*
 * Botones: como los de ergoibv.com ("Registrar licencia", "Iniciar sesión"): píldora azul marino
 * con borde blanco; al pasar el ratón, blanca con texto y borde azul marino. Sobre las columnas
 * oscuras el borde blanco la recorta; sobre blanco se ve la píldora azul.
 */

.ibvc .ibvc-button,
.ibvc button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	margin: 0 0.4em 0.4em 0;
	padding: 10px 22px;
	border: 2px solid #fff;
	border-radius: 50px;
	background: var(--ibvc-ink);
	box-shadow: none;
	color: #fff;
	font-family: Lato, sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 2px;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: color 0.2s linear, border-color 0.2s linear, background-color 0.2s linear;
}

.ibvc .ibvc-button:hover,
.ibvc .ibvc-button:focus,
.ibvc button[type="submit"]:hover,
.ibvc button[type="submit"]:focus {
	border-color: var(--ibvc-ink);
	background: #fff;
	color: var(--ibvc-ink);
}

/*
 * Secundarios (enviar y cerrar, cerrar, tomar, reabrir…): sin relleno y con el borde gris, para
 * distinguirlos del principal también sobre fondo oscuro; al pasar el ratón, como los principales.
 */
.ibvc .ibvc-button-secondary,
.ibvc button.ibvc-button-secondary {
	border-color: rgba(128, 128, 128, 0.55);
	background: transparent;
	color: inherit;
}

.ibvc .ibvc-inline-form {
	display: inline-block;
	margin: 0;
}

.ibvc .ibvc-thread-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin: 1.2em 0;
}

.ibvc .ibvc-links {
	margin: 0.6em 0 1.2em;
	font-size: 0.9em;
}

/* Avisos (fondo claro siempre, también sobre columnas oscuras). */

.ibvc-message {
	margin: 0 0 1.2em;
	padding: 0.8em 1.1em;
	border-left: 4px solid var(--ibvc-accent, #6194bf);
	border-radius: 4px;
	background: #eef4fa;
	color: #1d2327;
	font-size: 0.95em;
	text-align: left;
}

.ibvc-message p {
	margin: 0;
	color: inherit;
}

.ibvc-message a {
	color: inherit;
	text-decoration: underline;
}

.ibvc-message-success {
	border-color: #30a46c;
	background: #eaf7f0;
}

.ibvc-message-error {
	border-color: #e5484d;
	background: #fdeeee;
}

.ibvc-message-warning {
	border-color: #e2a336;
	background: #fdf6e7;
}

/* Texto de los ajustes sobre las consultas (p. ej. el SLA). */

.ibvc .ibvc-consultations-intro {
	margin: 0 0 1.4em;
	padding: 0.9em 1.2em;
	border: 1px solid rgba(97, 148, 191, 0.45);
	border-radius: 4px;
	font-size: 0.95em;
}

.ibvc .ibvc-consultations-intro > :last-child {
	margin-bottom: 0;
}

/* Tablas: filas con línea, sin rejilla. En el móvil, tarjetas. */

.ibvc .ibvc-table {
	width: 100%;
	margin: 0 0 1.2em;
	border: 0;
	border-collapse: collapse;
	font-size: 0.95em;
}

.ibvc .ibvc-table th,
.ibvc .ibvc-table td {
	padding: 0.75em 0.6em;
	border: 0;
	border-bottom: 1px solid var(--ibvc-line);
	background: transparent;
	color: inherit;
	text-align: left;
	vertical-align: top;
}

.ibvc .ibvc-table th {
	border-bottom-width: 2px;
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	white-space: nowrap;
}

.ibvc .ibvc-table tbody tr:hover td {
	background: var(--ibvc-soft);
}

.ibvc .ibvc-unread td:nth-child(-n + 2) a {
	font-weight: 700;
}

.ibvc .ibvc-badge {
	display: inline-block;
	min-width: 1.5em;
	margin-left: 0.4em;
	padding: 0 0.45em;
	border-radius: 1em;
	background: var(--ibvc-danger);
	color: #fff;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.5em;
	text-align: center;
}

.ibvc .ibvc-status {
	display: inline-block;
	padding: 0.15em 0.75em;
	border-radius: 50px;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.ibvc .ibvc-status-open {
	background: #fdf6e7;
	color: #8a5a00;
}

.ibvc .ibvc-status-answered {
	background: #e3eef8;
	color: #1f4f7a;
}

.ibvc .ibvc-status-closed {
	background: #ececef;
	color: #50535e;
}

.ibvc .ibvc-pagination {
	clear: both;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3em;
	margin: 0 0 1.5em;
}

.ibvc .ibvc-pagination .page-numbers {
	min-width: 2.2em;
	padding: 0.3em 0.6em;
	border: 1px solid var(--ibvc-line);
	border-radius: 50px;
	text-align: center;
	text-decoration: none;
}

.ibvc .ibvc-pagination .current {
	border-color: #fff;
	background: var(--ibvc-ink);
	color: #fff;
}

/* Bandeja: pestañas y filtro. */

.ibvc .ibvc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin: 0 0 1em;
}

.ibvc .ibvc-tabs a {
	padding: 0.35em 1.1em;
	border: 1px solid var(--ibvc-line);
	border-radius: 50px;
	font-size: 0.85em;
	text-decoration: none;
}

.ibvc .ibvc-tabs a.ibvc-tab-active {
	border-color: #fff;
	background: var(--ibvc-ink);
	color: #fff;
}

.ibvc .ibvc-inbox-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

.ibvc .ibvc-inbox-filter select {
	flex: 0 1 14em;
}

.ibvc .ibvc-inbox-filter input[type="search"] {
	flex: 1 1 16em;
}

.ibvc .ibvc-inbox-filter button[type="submit"] {
	margin: 0;
}

/* Consulta: mensajes. */

.ibvc .ibvc-thread-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em 0.8em;
	margin: 0 0 1em;
}

.ibvc .ibvc-thread-head h3 {
	margin: 0;
}

/* Ficha de la consulta (expertos y gestores): etiqueta y valor en filas. */
.ibvc .ibvc-thread-info {
	display: grid;
	gap: 0.5em;
	margin: 0 0 1.2em;
	padding: 0.9em 1.1em;
	border: 1px solid var(--ibvc-line);
	border-radius: var(--ibvc-radius);
	font-size: 0.95em;
}

.ibvc .ibvc-thread-info > div {
	display: grid;
	grid-template-columns: 9em 1fr;
	gap: 0 1em;
}

.ibvc .ibvc-thread-info dt {
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 1.5px;
	line-height: 2;
	text-transform: uppercase;
	opacity: 0.75;
}

.ibvc .ibvc-thread-info dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.ibvc .ibvc-messages {
	margin: 1.2em 0 1.5em;
}

.ibvc .ibvc-msg {
	display: flow-root;
	margin: 0 0 0.9em;
	padding: 0.9em 1.1em;
	border: 1px solid var(--ibvc-line);
	border-radius: var(--ibvc-radius);
	background: var(--ibvc-soft);
}

.ibvc .ibvc-msg-expert {
	border-color: rgba(97, 148, 191, 0.6);
	background: rgba(97, 148, 191, 0.14);
}

.ibvc .ibvc-msg-head {
	margin: 0 0 0.5em;
	font-size: 0.85em;
	opacity: 0.85;
}

.ibvc .ibvc-msg-body p {
	margin: 0 0 0.6em;
}

.ibvc .ibvc-msg-body p:last-child {
	margin-bottom: 0;
}

.ibvc ul.ibvc-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin: 0.7em 0 0;
	padding: 0;
	list-style: none;
}

.ibvc ul.ibvc-attachments li {
	margin: 0;
	padding: 0.2em 0.8em;
	border: 1px solid var(--ibvc-line);
	border-radius: 50px;
	font-size: 0.85em;
}

.ibvc .ibvc-file-size {
	opacity: 0.75;
}

/* Registro y perfil. */

.ibvc .ibvc-license-summary dt {
	font-weight: 700;
}

.ibvc .ibvc-license-summary dd {
	margin: 0 0 0.6em;
}

.ibvc .ibvc-strength {
	display: block;
	margin-top: 0.3em;
	font-size: 0.85em;
}

.ibvc .ibvc-strength-0,
.ibvc .ibvc-strength-1,
.ibvc .ibvc-strength-2 {
	color: var(--ibvc-danger);
}

.ibvc .ibvc-strength-3 {
	color: #e2a336;
}

.ibvc .ibvc-strength-4 {
	color: #30a46c;
}

/* Secciones dentro de una misma pantalla (perfil, aviso de ausencia). */
.ibvc-profile h3:not(:first-child),
.ibvc .ibvc-table + h3,
.ibvc .ibvc-pagination + h3 {
	margin-top: 1.6em;
	padding-top: 1.2em;
	border-top: 1px solid var(--ibvc-line);
}

@media (max-width: 640px) {
	.ibvc .ibvc-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.ibvc .ibvc-table,
	.ibvc .ibvc-table tbody,
	.ibvc .ibvc-table tr,
	.ibvc .ibvc-table td {
		display: block;
		width: auto;
	}

	.ibvc .ibvc-table tr {
		padding: 0.6em 0;
		border-bottom: 1px solid var(--ibvc-line);
	}

	.ibvc .ibvc-table td {
		padding: 0.15em 0;
		border: 0;
		overflow-wrap: break-word;
	}

	.ibvc .ibvc-table td::before {
		content: attr(data-label);
		display: block;
		font-size: 0.7em;
		font-weight: 700;
		letter-spacing: 1px;
		text-transform: uppercase;
		opacity: 0.7;
	}

	.ibvc .ibvc-table td + td {
		margin-top: 0.35em;
	}

	.ibvc .ibvc-button,
	.ibvc button[type="submit"] {
		width: 100%;
		margin-right: 0;
	}

	.ibvc .ibvc-inline-form {
		display: block;
		width: 100%;
	}

	.ibvc .ibvc-thread-info > div {
		grid-template-columns: 1fr;
	}
}
