/* The portal frame: colours, top bar, the "Log in | Register" switch, titles, page padding.
   Loaded first under "ovemo-theme-portal" - the other portal files use its colours. See README.MD, "Стилът на портала". */
.ovemo-portal {
	--ovemo-bg: #ffffff;
	--ovemo-card: #ffffff;
	--ovemo-tile: #f6f8fb;
	--ovemo-tile-hover: #edf2f9;
	--ovemo-shadow: 0 1px 2px rgba(29, 58, 99, .06), 0 4px 14px rgba(29, 58, 99, .06);
	--ovemo-frame-shadow: 0 2px 10px rgba(0, 0, 0, .08);
	--ovemo-fg: #1f2733;
	--ovemo-muted: #5a6b82;
	--ovemo-line: #dcdcde;
	--ovemo-accent: #2271b1;
	--ovemo-navy: #1d3a63;
	--ovemo-warn: #b32d2e;
	--ovemo-warn-soft: #fcf0f0;
	--ovemo-ok: #2e7d4f;
	--ovemo-ok-soft: #edf7f0;
	--ovemo-chip: #eef2f8;
	background: var(--ovemo-bg);
	color: var(--ovemo-fg);
	font-size: 14px;
	color-scheme: light;
}

.ovemo-portal *,
.ovemo-portal *::before,
.ovemo-portal *::after { box-sizing: border-box; }

/* The page of the portal on the whole screen (HVAC CRM, templates/portal-page.php) - always white. */
body.ovemo-portal-body { margin: 0; background: #ffffff; }

.ovemo-bar { background: var(--ovemo-navy); color: #fff; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ovemo-bar-in { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.ovemo-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; text-decoration: none; }
.ovemo-brand img { max-height: 30px; width: auto; background: #fff; border-radius: 4px; padding: 2px 4px; }

.ovemo-page { max-width: 1180px; margin: 0 auto; padding-block: 22px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; }

/* The door inside a page of the site - one card, as the login of the old portal: the switch on top,
   the form without its own card. */
.ovemo-portal.is-door { max-width: 1000px; margin: 0 auto; background: #fff; border-radius: 8px; box-shadow: 0 0 10px 2px rgba(43, 108, 176, .55); font-size: 16px; }
.ovemo-portal.is-door .ovemo-page { display: block; padding: 0 24px 24px; }
/* Phone: less padding inside the card - more room for the fields. */
@media (max-width: 720px) {
	.ovemo-portal.is-door .ovemo-page { padding: 0 14px 16px; }
	/* Only the page of the door: the card 15 px from the edge of the screen (the page and its white box added 33 px more). */
	:is(.main-content, article):has(.ovemo-portal.is-door) { padding-left: 0; padding-right: 0; }
	.ovemo-portal.is-door .ovemo-switch a { padding: 10px 14px; }
	/* The button smaller; a long text goes to a second row, never under the edge. */
	.ovemo-portal.is-door .ovemo-btn { font-size: 15px; padding: 10px 12px; white-space: normal; line-height: 1.3; }
}
.ovemo-portal.is-door .ovemo-switch { justify-content: flex-start; margin: 0 0 16px; border-bottom-color: #7c8591; }
.ovemo-portal.is-door .ovemo-switch a { padding: 10px 20px; font-size: 16px; }
.ovemo-portal.is-door .ovemo-switch a[aria-current="page"] { color: #2b6cb0; border-bottom-color: #2b6cb0; }
.ovemo-portal.is-door .ovemo-form { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; gap: 16px; }
.ovemo-portal.is-door .ovemo-switch ~ .ovemo-form > h2 { display: none; }
.ovemo-portal.is-door .ovemo-field { gap: 4px; font-size: 16px; color: #1a202c; }
.ovemo-portal.is-door .ovemo-field input { min-height: 46px; padding: 8px 10px; border-color: #7c8591; border-radius: 6px; }
.ovemo-portal.is-door .ovemo-actions { justify-content: flex-start; }
.ovemo-portal.is-door .ovemo-btn { font-size: 16px; padding: 12px 20px; border-radius: 8px; background: #234982; box-shadow: none; }
.ovemo-portal.is-door .ovemo-links { flex-direction: column; gap: 8px; }
.ovemo-portal.is-door .ovemo-links a,
.ovemo-portal.is-door .ovemo-links button { font-size: 16px; color: #2f7fe0; text-decoration: none; }
.ovemo-portal.is-door .ovemo-small { margin: 16px 0 0; }

/* "Log in | Register" - links, each opens its own screen. */
.ovemo-switch { display: flex; flex-wrap: wrap; justify-content: center; border-bottom: 1px solid var(--ovemo-line); }
.ovemo-switch a { padding: 10px 18px; color: var(--ovemo-muted); text-decoration: none; border-bottom: 2px solid transparent; }
.ovemo-switch a[aria-current="page"] { color: var(--ovemo-accent); border-bottom-color: var(--ovemo-accent); font-weight: 700; }
.ovemo-switch a:focus-visible { outline: 2px solid var(--ovemo-accent); outline-offset: 2px; }

.ovemo-small { color: var(--ovemo-muted); font-size: 12px; text-align: center; margin: 0; }

/* Every frame in the portal - one look, as the cards of the CRM pages (.hvac-crm-field-row, e.g. "Bulk sending"): white, no line, a soft shadow. */
.ovemo-form,
.ovemo-empty,
.ovemo-rows,
.ovemo-portal :is(.hvac-crm-field-row, .hvac-portal-site, .hvac-portal-form-card, .hvac-confirm-box, .hvac-portal-review-card, .hvac-portal-soft-card, .hvac-portal-signbox, .ovemo-legend) { background: var(--ovemo-card); border: 0; border-radius: 10px; box-shadow: var(--ovemo-frame-shadow); }

/* The site's lines on every table cell (style.css: table, th, td) stay out of the portal; :where keeps it below any own rule. */
.ovemo-portal :where(table, th, td) { border: 0; }

/* The "Save" of a frame - in the middle, as in every frame of the portal. */
.ovemo-portal :is(.hvac-crm-field-row, .hvac-portal-soft-card) form > p:last-child { text-align: center; }
