/**
 * Forms, buttons, plan boxes and tables of the account portal.
 *
 * @version 2026-10-29
 */

div.content.public
{
	max-width: 460px;
	margin: 0 auto;
}

.form-table
{
	width: 100%;
	border-collapse: collapse;
}

.form-table td
{
	padding: 6px 4px;
	vertical-align: middle;
}

.form-table td.label
{
	width: 38%;
	white-space: nowrap;
}

@media screen and (max-width: 640px)
{
	.form-table, .form-table tbody, .form-table tr, .form-table td { display: block; width: 100%; box-sizing: border-box; }
	.form-table td.label { width: 100%; padding-bottom: 0; }
}

.form-hint
{
	margin: 4px 0 0 0;
	color: #777777;
	font-size: 85%;
}

a.button, button.button, input.button
{
	display: inline-block;
	box-sizing: border-box;
	padding: 8px 16px;
	border: 0;
	border-radius: 10px;
	background-color: #5785ec;
	color: #FFFFFF;
	font: inherit;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	text-shadow: none;
}

a.button:hover, button.button:hover, input.button:hover { background-color: #3f6fd9; }
a.button.secondary, button.button.secondary { background-color: #EEEEEE; color: #333333; }
a.button.secondary:hover, button.button.secondary:hover { background-color: #DDDDDD; }
a.button.danger, button.button.danger { background-color: #c0392b; background-image: none; color: #FFFFFF; text-shadow: none; }
a.button.danger:hover, button.button.danger:hover { background-color: #a5281b; }
a.button[disabled], button.button[disabled] { opacity: 0.55; pointer-events: none; }

fieldset.plan
{
	margin: 0 0 22px 0;
	padding: 4px 18px 16px 18px;
	border: 1px solid #d1eeff;
	border-radius: 10px;
}

fieldset.plan legend { padding: 0 8px; }
fieldset.plan legend h2 { display: inline; margin: 0; }

.badge
{
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: #E6EAEF;
	color: #333333;
	font-size: 80%;
	vertical-align: middle;
}

.badge.ok { background: #d8f5df; color: #176a2c; }
.badge.warn { background: #fff0c2; color: #7a5a00; }
.badge.bad { background: #fadbd8; color: #8e1d12; }

div.card
{
	border: 2px solid #c2def8;
	border-radius: 10px;
	background-color: #e1f5ff;
	margin-bottom: 15px;
}

div.card h4
{
	margin: 0;
	padding: 14px 20px;
}

.plan-options
{
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 18px 0;
}

.plan-option
{
	flex: 1 1 240px;
	box-sizing: border-box;
	padding: 18px;
	border: 2px solid #c2def8;
	border-radius: 12px;
	background: #FFFFFF;
}

.plan-option h3 { margin-top: 0; }
.plan-option .price { font-size: 1.6em; font-weight: bold; }
.plan-option form { margin: 10px 0 0 0; }
.plan-option form button { width: 100%; }

table.data
{
	width: 100%;
	border-collapse: collapse;
}

table.data th, table.data td
{
	padding: 8px 10px;
	border-bottom: 1px solid #E6EAEF;
	text-align: left;
}

table.data td.num, table.data th.num { text-align: right; }

.table-scroll { overflow-x: auto; }

/* ===== Card editor ===== */

/* Adds Animation to Accordion jQuery Mobile Component */
.ui-collapsible-content
{
	-webkit-transition: all 0.5s linear;
	transition: all 0.5s linear;
	overflow: hidden;
}

.ui-collapsible-content-collapsed
{
	display: block;
	height: 0px;
	padding: 0 16px;
}

span.status { margin-left: 10px; font-size: 90%; white-space: pre-line; }
span.status.success { color: #176a2c; }
span.status.failed { color: #b40000; }

.form-error { color: #b40000; }

span.social-button
{
	display: inline-block;
	width: 65px;
	height: 65px;
	border-radius: 40px;
	line-height: 65px;
	color: #FFFFFF;
	background-color: #000000;
	font-size: 23pt;
	text-align: center;
	text-decoration: none;
	-webkit-font-smoothing: antialiased;
	transition: opacity 0.3s ease-in-out;
	opacity: 1;
}

span.social-button:hover { opacity: 0.7; }

#social-buttons span.social-button
{
	position: absolute;
	left: 7px;
	top: 7px;
}

#social-buttons h2, #social-buttons p
{
	padding-left: 70px;
	text-align: left;
}

#social-buttons { max-width: 450px; }

#iconSelector div.social-button-list div.ui-collapsible-content { padding: 2px; }
#iconSelector div.social-button-list span.social-button { margin: 3px; cursor: pointer; }

.image-box
{
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin: 12px 0 22px 0;
}

.image-box .preview
{
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 2px dashed #c2def8;
	background: #F4F8FB;
	color: #8aa0b4;
	text-align: center;
}

.image-box .preview.logo { width: 110px; height: 110px; border-radius: 50%; }
.image-box .preview.header { width: 260px; height: 104px; border-radius: 10px; }
.image-box .preview img { width: 100%; height: 100%; object-fit: cover; }
.image-box input[type=file] { max-width: 260px; }

.look-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 10px 0; }
.look-row label { margin-right: 6px; }

.danger-zone { margin-top: 30px; padding-top: 10px; border-top: 1px solid #E6EAEF; }


/* ===== Page layout, header, menu and footer (2026-10-28) ===== */

/* Links that look like buttons keep the button text color. jQuery Mobile colors every link inside of its pages, so this needs a more specific selector. */
body a.button, body a.button:visited, body .ui-body-a a.button, body .ui-page-theme-a a.button
{
	color: #FFFFFF;
	text-decoration: none;
	font-weight: normal;
	text-shadow: none;
}

body a.button.secondary, body a.button.secondary:visited { color: #333333; }
body a.button.danger, body a.button.danger:visited { color: #FFFFFF; }

/* The footer stays at the bottom of the screen on short pages */
html, body { min-height: 100%; }
html body, html body.ui-page.ui-page-active { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; } /* jQuery Mobile sets display:block on the page, so the selector is more specific */
html body > div.frame { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
div.footer { flex-shrink: 0; margin-top: 30px; padding: 28px 16px; font-size: 90%; }

/* Header with the logo. The logo is loaded from the main site, so the bar has its own height and does not depend on the picture. */
div.header
{
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 64px;
	padding: 10px 16px;
	border-bottom: 1px solid #E6EAEF;
}

div.header a { display: inline-flex; align-items: center; }
div.header img { display: block; width: auto; height: auto; max-width: 60vw; max-height: 42px; }

/* The menu on the left is easier to read, and the open menu of a phone is not hidden under the header */
ul.main-menu li a { color: #444444; font-weight: bold; }
ul.main-menu li a:hover { color: #3768dc; }

@media screen and (max-width: 640px)
{
	div.content { margin-left: 0; }
	ul.main-menu { float: none; margin: 0; padding: 0 16px; width: 100%; box-sizing: border-box; font-size: large; }
	ul.main-menu li a { line-height: 52px; width: 100%; box-sizing: border-box; }
	ul.main-menu li a:hover { width: 100%; }
}

/* Content has comfortable side space on a phone, and fields are as wide as the screen allows */
div.content { box-sizing: border-box; padding-left: 16px; padding-right: 16px; }

@media screen and (max-width: 640px)
{
	div.content input[type=text], div.content input[type=email], div.content input[type=password], div.content input[type=url], div.content input[type=tel], div.content input[type=number], div.content select, div.content textarea
	{
		width: 100%;
		box-sizing: border-box;
	}

	/* 16 pixels keeps iPhones from zooming into a field when it is touched */
	div.content input, div.content select, div.content textarea { font-size: 16px; }

	/* Big buttons are easier to touch */
	a.button, button.button, input.button, input[type=submit], div.content button { min-height: 44px; }
	.form-table input[type=submit], .form-table button { width: 100%; }

	h1 { margin: 18px 0 14px 0; }
	fieldset.plan { padding: 2px 14px 14px 14px; }
}

/* Tables turn into lists of small boxes on a phone, so they do not need to be scrolled */
@media screen and (max-width: 640px)
{
	table.data.stack, table.data.stack tbody { display: block; width: 100%; }
	table.data.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	table.data.stack tr { display: block; margin: 0 0 12px 0; padding: 4px 0; border: 1px solid #E6EAEF; border-radius: 10px; background: #FFFFFF; }
	table.data.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 0; padding: 6px 12px; text-align: right; }
	table.data.stack td::before { content: attr(data-label); flex: 0 0 auto; font-weight: bold; color: #555555; text-align: left; }
	table.data.stack td.actions { justify-content: flex-end; }
	table.data.stack td.actions::before { content: none; }
	table.data.stack td.actions:not(:has(*)) { display: none; }
	table.data.stack td.actions form { width: 100%; }
	table.data.stack td.actions .button { width: 100%; }
}

/* The delete button is as wide as its text on a large screen, and as wide as the screen on a phone */
.danger-zone a.button, .danger-zone button.button { width: auto; }

@media screen and (max-width: 640px)
{
	.danger-zone a.button, .danger-zone button.button { width: 100%; }
}


/* ===== Layout picker of the card editor (2026-10-28) ===== */

.layout-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 12px 0; }

.layout-tile
{
	position: relative;
	display: block;
	box-sizing: border-box;
	padding: 8px 8px 10px;
	border: 2px solid #E6EAEF;
	border-radius: 12px;
	background: #FFFFFF;
	cursor: pointer;
	text-align: left;
}

.layout-tile:hover { border-color: #AEB9C6; }
.layout-tile.selected { border-color: #2C3E50; box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.18); }
.layout-tile input { position: absolute; top: 14px; left: 14px; width: 20px; height: 20px; margin: 0; accent-color: #2C3E50; }
.layout-tile input:focus-visible { outline: 3px solid #4C9AFF; outline-offset: 2px; }
.layout-tile img { display: block; width: 100%; height: auto; border-radius: 8px; }
.layout-tile .layout-name { display: block; margin-top: 8px; font-weight: 700; font-size: 16px; }
.layout-tile .layout-about { display: block; margin-top: 2px; color: #5B6776; font-size: 13px; line-height: 1.35; }

@media (max-width: 520px) { .layout-picker { grid-template-columns: 1fr; } }


/* ===== Language selector in the header (2026-10-29) ===== */

/* A round button with the flag. On a wide page it is at the right end of the header, on a phone it is to the left of the menu button (44 px wide, 10 px from the edge). */
div.header details.lang-switch { margin-left: auto; position: relative; z-index: 3; }
div.header details.lang-switch > summary
{
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;
	list-style: none;
	border: 1px solid #D5DBE3;
	border-radius: 50%;
	background: #FFFFFF;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}
div.header details.lang-switch > summary::-webkit-details-marker { display: none; }
div.header details.lang-switch > summary::marker { content: ''; }
div.header details.lang-switch > summary:hover, div.header details.lang-switch[open] > summary { border-color: #3768dc; }
div.header details.lang-switch > summary:focus-visible { outline: 2px solid #3768dc; outline-offset: 2px; }
div.header details.lang-switch > summary img { display: block; width: 32px; height: 32px; max-width: none; max-height: none; border-radius: 50%; }
div.header details.lang-switch .lang-code { font-size: 13px; font-weight: bold; color: #555555; }

div.header ul.lang-menu
{
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	box-sizing: border-box;
	min-width: 210px;
	max-height: calc(100vh - 96px);
	max-height: calc(100dvh - 96px);
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	list-style: none;
	background: #FFFFFF;
	border: 1px solid #D5DBE3;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
div.header ul.lang-menu li { margin: 0; padding: 0; border: 0; }
div.header ul.lang-menu a
{
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	min-height: 44px;
	padding: 4px 12px;
	border-radius: 8px;
	color: #333333;
	text-decoration: none;
	white-space: nowrap;
}
div.header ul.lang-menu a:hover, div.header ul.lang-menu a:focus-visible { background: #F1F4F9; outline: none; }
div.header ul.lang-menu a.current { font-weight: bold; background: #EAF0FF; }
div.header ul.lang-menu img { display: block; flex: 0 0 auto; width: 24px; height: 24px; max-width: none; max-height: none; border-radius: 50%; }
div.header ul.lang-menu .lang-code { flex: 0 0 24px; text-align: center; font-size: 11px; font-weight: bold; color: #555555; }

@media screen and (max-width: 640px)
{
	div.header.has-menu details.lang-switch { margin-right: 54px; }
	div.header ul.lang-menu { right: -54px; max-width: calc(100vw - 24px); }
	div.header:not(.has-menu) ul.lang-menu { right: 0; }
}
