/**
 * Masterdish Staff Portal — front-end styles.
 *
 * Brand: #0C1F61 (navy), #3BB8FF (sky), white.
 *
 * The portal renders inside the host theme's content area, so the theme's own
 * link and typography rules apply to everything here. Several declarations below
 * are marked !important on purpose: they are the ones an Elementor/Hostinger
 * theme reliably overrides (link colour, underline, heading colour). Everything
 * else is kept at normal specificity.
 *
 * @package Masterdish_Portal
 */

.md-portal {
	--md-navy: #0c1f61;
	--md-navy-700: #16307f;
	--md-navy-900: #081447;
	--md-navy-050: #eef2fb;
	--md-navy-100: #dee6f7;
	--md-sky: #3bb8ff;
	--md-sky-600: #1a9de8;
	--md-sky-050: #eaf7ff;
	--md-white: #fff;
	--md-ink: #16233d;
	--md-muted: #5b6b8c;
	--md-line: #dfe5f1;
	--md-danger: #c0342b;
	--md-danger-bg: #fdeceb;
	--md-success: #157a4d;
	--md-success-bg: #e8f6ef;
	--md-warn: #b06d00;
	--md-warn-bg: #fff6e5;

	--md-radius: 16px;
	--md-radius-sm: 10px;
	--md-shadow-sm: 0 1px 2px rgba( 12, 31, 97, 0.05 );
	--md-shadow: 0 1px 2px rgba( 12, 31, 97, 0.05 ), 0 10px 30px -12px rgba( 12, 31, 97, 0.18 );
	--md-shadow-lg: 0 24px 48px -20px rgba( 12, 31, 97, 0.35 );

	box-sizing: border-box;
	width: 100%;
	max-width: 1180px;
	/* Horizontal padding matters on Elementor Canvas, which has no theme container. */
	margin: 0 auto;
	padding: 28px 22px 64px;
	color: var( --md-ink );
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.md-portal *,
.md-portal *::before,
.md-portal *::after {
	box-sizing: inherit;
}

/*
 * Hide the theme's own page heading above the portal — the portal renders its
 * own branded header, so the theme title is a duplicate. The body class is
 * added by MD_Shortcodes::prepare_portal_page(); these selectors cover the
 * common theme patterns, since the heading lives outside the shortcode.
 */
body.md-portal-page .page-header,
body.md-portal-page .entry-header,
body.md-portal-page .entry-title,
body.md-portal-page .page-title,
body.md-portal-page .wp-block-post-title {
	display: none !important;
}

/* Kill the host theme's link decoration everywhere inside the portal. */
.md-portal a,
.md-portal a:link,
.md-portal a:visited,
.md-portal a:hover,
.md-portal a:focus,
.md-portal a:active {
	text-decoration: none !important;
	box-shadow: none !important;
	border-bottom: 0 !important;
}

.md-portal h1,
.md-portal h2,
.md-portal h3 {
	margin: 0;
	font-family: inherit;
	letter-spacing: -0.015em;
}

.md-portal p {
	margin: 0;
}

.md-portal :focus-visible {
	outline: 3px solid rgba( 59, 184, 255, 0.55 );
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- Header */

.md-portal__bar {
	display: flex !important;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 9px 14px;
	margin-bottom: 22px;
	background: linear-gradient( 120deg, var( --md-navy-900 ) 0%, var( --md-navy ) 55%, var( --md-navy-700 ) 100% );
	border-radius: var( --md-radius );
	box-shadow: var( --md-shadow-lg );
	color: var( --md-white );
}

.md-portal__brand {
	display: flex !important;
	align-items: center;
	gap: 14px;
	margin-right: auto;
	min-width: 0;
}

.md-portal__user {
	display: flex !important;
}

/*
 * The Masterdish logo is navy-on-transparent, so it would vanish on the navy
 * bar. A white chip keeps it legible without recolouring the artwork.
 */
.md-portal__logo {
	display: grid;
	place-items: center;
	padding: 6px 12px;
	background: var( --md-white );
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.18 );
}

.md-portal__logo img {
	display: block;
	width: auto;
	height: 28px;
	max-width: 200px;
	object-fit: contain;
}

.md-portal__mark {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var( --md-sky );
	color: var( --md-navy );
	font-weight: 800;
	font-size: 21px;
	line-height: 1;
}

.md-portal__mark--lg {
	width: 58px;
	height: 58px;
	font-size: 30px;
	border-radius: 16px;
}

.md-portal__brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
	min-width: 0;
}

.md-portal__brand-text strong {
	color: var( --md-white ) !important;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.md-portal__brand-text small {
	color: rgba( 255, 255, 255, 0.66 ) !important;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.md-portal__nav {
	display: flex !important;
	align-items: center;
	flex-wrap: nowrap;
	gap: 4px;
	max-width: 100%;
	padding: 4px;
	background: rgba( 255, 255, 255, 0.08 );
	border-radius: 999px;
	/* Scroll rather than wrap, so the pill bar never breaks into ragged rows. */
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.md-portal__nav::-webkit-scrollbar {
	display: none;
}

.md-portal .md-nav-link {
	display: flex !important;
	align-items: center;
	flex: 0 0 auto;
	height: 34px;
	padding: 0 16px;
	border-radius: 999px;
	color: rgba( 255, 255, 255, 0.82 ) !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.md-portal .md-nav-link:hover,
.md-portal .md-nav-link:focus-visible {
	background: rgba( 255, 255, 255, 0.16 );
	color: var( --md-white ) !important;
}

.md-portal .md-nav-link.is-active {
	background: var( --md-white );
	color: var( --md-navy ) !important;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.16 ) !important;
}

.md-portal__user {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-left: 18px;
	border-left: 1px solid rgba( 255, 255, 255, 0.18 );
	font-size: 14px;
}

.md-portal__avatar {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var( --md-sky );
	color: var( --md-navy );
	font-weight: 700;
	font-size: 14px;
}

.md-portal__user-name {
	color: var( --md-white ) !important;
	font-weight: 600;
}

.md-portal .md-portal__signout {
	color: var( --md-sky ) !important;
	font-weight: 600;
	font-size: 13px;
}

.md-portal .md-portal__signout:hover {
	color: var( --md-white ) !important;
}

/* ------------------------------------------------------------- Page head */

.md-page-head {
	margin-bottom: 20px;
}

.md-portal .md-page-head__title {
	margin: 0 0 4px;
	color: var( --md-navy ) !important;
	font-size: clamp( 22px, 2.6vw, 28px );
	font-weight: 800;
	line-height: 1.2;
}

.md-page-head__subtitle {
	color: var( --md-muted );
	font-size: 15px;
}

/* ----------------------------------------------------------------- Stats */

.md-stat-row {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 12px;
	margin-bottom: 20px;
}

.md-stat {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding: 13px 16px;
	overflow: hidden;
	background: var( --md-white );
	border: 1px solid var( --md-line );
	border-radius: var( --md-radius-sm );
	box-shadow: var( --md-shadow-sm );
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.md-stat::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 4px;
	background: linear-gradient( 180deg, var( --md-sky ) 0%, var( --md-navy ) 100% );
}

.md-stat:hover {
	transform: translateY( -2px );
	box-shadow: var( --md-shadow );
}

.md-stat__value {
	color: var( --md-navy );
	font-size: 26px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.md-stat__label {
	color: var( --md-muted );
	font-size: 13px;
	font-weight: 500;
}

/* --------------------------------------------------------------- Actions */

.md-action-grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 14px;
	margin-bottom: 20px;
}

/*
 * Layout-critical properties carry !important here. The card is an <a> holding
 * two <span>s, and the theme/Elementor stylesheets set display and width on
 * those, which collapsed the row into a stack with the icon stranded on top.
 */
.md-portal .md-action-card {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	gap: 14px;
	padding: 18px;
	background: var( --md-white );
	border: 1px solid var( --md-line );
	border-radius: var( --md-radius );
	box-shadow: var( --md-shadow-sm );
	color: var( --md-ink ) !important;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.md-portal .md-action-card:hover,
.md-portal .md-action-card:focus-visible {
	transform: translateY( -3px );
	border-color: var( --md-sky );
	box-shadow: var( --md-shadow );
}

/* The navy card: force every descendant white, the theme colours links. */
.md-portal .md-action-card--primary,
.md-portal .md-action-card--primary strong,
.md-portal .md-action-card--primary small {
	color: var( --md-white ) !important;
}

.md-portal .md-action-card--primary {
	background: linear-gradient( 130deg, var( --md-navy-900 ) 0%, var( --md-navy ) 60%, var( --md-navy-700 ) 100% );
	border-color: transparent;
	box-shadow: var( --md-shadow );
}

.md-portal .md-action-card--primary:hover {
	border-color: var( --md-sky );
	box-shadow: var( --md-shadow-lg );
}

.md-portal .md-action-card__icon {
	display: flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 46px !important;
	width: 46px !important;
	height: 46px;
	border-radius: 12px;
	background: var( --md-sky-050 );
	color: var( --md-navy );
}

.md-action-card__icon svg {
	width: 24px;
	height: 24px;
}

.md-action-card--primary .md-action-card__icon {
	background: rgba( 59, 184, 255, 0.18 );
	color: var( --md-sky );
}

.md-portal .md-action-card__text {
	display: flex !important;
	flex-direction: column !important;
	gap: 2px;
	flex: 1 1 auto !important;
	min-width: 0;
	width: auto !important;
}

.md-action-card__text strong {
	display: block;
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1.3;
}

.md-action-card__text small {
	display: block;
	font-size: 12.5px;
	line-height: 1.45;
	opacity: 0.78;
}

/* ----------------------------------------------------------------- Cards */

.md-card {
	padding: 26px;
	margin-bottom: 20px;
	background: var( --md-white );
	border: 1px solid var( --md-line );
	border-radius: var( --md-radius );
	box-shadow: var( --md-shadow-sm );
}

.md-portal .md-card__title {
	position: relative;
	margin: 0 0 20px;
	padding: 0 0 14px 14px;
	border-bottom: 1px solid var( --md-navy-100 );
	color: var( --md-navy ) !important;
	font-size: 17px;
	font-weight: 700;
}

.md-card__title::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 0;
	width: 4px;
	height: 18px;
	border-radius: 2px;
	background: var( --md-sky );
}

/* ---------------------------------------------------------------- Fields */

.md-field {
	margin-bottom: 20px;
}

.md-field:last-child {
	margin-bottom: 0;
}

.md-field-row {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 180px, 1fr ) );
	gap: 18px;
}

.md-field__label {
	display: block;
	margin-bottom: 7px;
	color: var( --md-navy );
	font-size: 14px;
	font-weight: 600;
}

.md-field__hint {
	margin-top: 7px;
	color: var( --md-muted );
	font-size: 13px;
}

.md-field__hint--warn {
	color: var( --md-danger );
	font-weight: 600;
}

.md-field__optional {
	margin-left: 6px;
	padding: 2px 7px;
	background: var( --md-navy-050 );
	border-radius: 4px;
	color: var( --md-muted );
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.md-required {
	color: var( --md-danger );
}

.md-portal .md-input {
	display: block;
	width: 100%;
	padding: 12px 14px;
	background: var( --md-white );
	border: 1px solid var( --md-line );
	border-radius: var( --md-radius-sm );
	color: var( --md-ink );
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.md-portal .md-input:hover {
	border-color: #c3cee4;
}

.md-portal .md-input:focus {
	border-color: var( --md-sky );
	box-shadow: 0 0 0 4px rgba( 59, 184, 255, 0.18 );
	outline: none;
}

.md-portal .md-textarea {
	min-height: 120px;
	resize: vertical;
}

.md-portal .md-select {
	padding: 6px;
}

.md-portal .md-select option {
	padding: 8px 10px;
	border-radius: 6px;
}

.md-searchable {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.md-field--compact {
	display: flex;
	flex-direction: column;
}

.md-duration {
	display: inline-block;
	padding: 12px 14px;
	background: var( --md-navy-050 );
	border: 1px solid var( --md-navy-100 );
	border-radius: var( --md-radius-sm );
	color: var( --md-navy );
	font-size: 15px;
	font-weight: 700;
	text-align: center;
}

.md-duration.is-invalid {
	background: var( --md-danger-bg );
	border-color: #f2c4c0;
	color: var( --md-danger );
}

.md-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-top: 18px;
	padding: 14px 16px;
	background: var( --md-navy-050 );
	border: 1px solid var( --md-navy-100 );
	border-radius: var( --md-radius-sm );
	font-size: 14px;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.md-checkbox:hover {
	border-color: var( --md-sky );
}

.md-checkbox input {
	margin-top: 4px;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	accent-color: var( --md-navy );
}

.md-file-list {
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
}

.md-file-list li {
	padding: 7px 12px;
	margin-bottom: 5px;
	background: var( --md-navy-050 );
	border-radius: 7px;
	color: var( --md-muted );
}

.md-file-list li.is-invalid {
	background: var( --md-danger-bg );
	color: var( --md-danger );
	font-weight: 600;
}

/* ------------------------------------------------------------- Signature */

.md-signature-grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 290px, 1fr ) );
	gap: 20px;
}

.md-signature-grid--single {
	grid-template-columns: minmax( 290px, 500px );
}

.md-signature {
	padding: 16px;
	background: var( --md-navy-050 );
	border: 1px solid var( --md-navy-100 );
	border-radius: var( --md-radius-sm );
	transition: border-color 0.18s ease, background-color 0.18s ease;
}

.md-signature.is-signed {
	background: var( --md-success-bg );
	border-color: #9fd6bd;
}

.md-signature.has-error {
	background: var( --md-danger-bg );
	border-color: var( --md-danger );
}

.md-signature.is-waived {
	opacity: 0.5;
}

.md-signature__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.md-signature__head .md-field__label {
	margin-bottom: 0;
}

.md-signature__canvas {
	display: block;
	width: 100%;
	height: 175px;
	background: var( --md-white );
	border: 1px dashed #b9c6e0;
	border-radius: 8px;
	cursor: crosshair;
	touch-action: none;
}

.md-signature.is-signed .md-signature__canvas {
	border-style: solid;
	border-color: var( --md-success );
}

.md-signature__hint {
	margin-top: 9px;
	color: var( --md-muted );
	font-size: 12px;
}

/* --------------------------------------------------------------- Buttons */

.md-portal .md-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 26px;
	border: 1px solid transparent;
	border-radius: var( --md-radius-sm );
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.md-portal .md-btn--primary {
	background: linear-gradient( 130deg, var( --md-navy ) 0%, var( --md-navy-700 ) 100% );
	color: var( --md-white ) !important;
	box-shadow: 0 6px 18px -8px rgba( 12, 31, 97, 0.7 );
}

.md-portal .md-btn--primary:hover:not( :disabled ),
.md-portal .md-btn--primary:focus-visible:not( :disabled ) {
	transform: translateY( -1px );
	box-shadow: 0 10px 24px -8px rgba( 12, 31, 97, 0.75 );
}

.md-portal .md-btn--primary:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

.md-portal .md-btn--ghost {
	background: var( --md-white );
	border-color: var( --md-line );
	color: var( --md-navy ) !important;
}

.md-portal .md-btn--ghost:hover,
.md-portal .md-btn--ghost:focus-visible {
	background: var( --md-navy-050 );
	border-color: var( --md-navy );
}

.md-portal .md-btn--sm {
	padding: 7px 14px;
	font-size: 13px;
}

.md-form__actions {
	position: sticky;
	bottom: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	padding: 20px 26px;
	background: var( --md-white );
	border: 1px solid var( --md-navy-100 );
	border-radius: var( --md-radius );
	box-shadow: var( --md-shadow );
}

.md-form__lock-warning {
	color: var( --md-navy );
	font-size: 14px;
	font-weight: 600;
}

.md-form__buttons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* ---------------------------------------------------------------- Alerts */

.md-alert {
	padding: 16px 20px;
	margin-bottom: 22px;
	border-radius: var( --md-radius-sm );
	border-left: 4px solid;
	font-size: 14px;
}

.md-alert--error {
	background: var( --md-danger-bg );
	border-color: var( --md-danger );
	color: #7e211b;
}

.md-alert ul {
	margin: 8px 0 0;
	padding-left: 20px;
}

.md-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	background: var( --md-sky-050 );
	border: 1px solid rgba( 59, 184, 255, 0.42 );
	border-radius: var( --md-radius-sm );
	color: var( --md-navy );
}

.md-notice p {
	font-size: 14px;
}

.md-notice svg {
	flex: 0 0 auto;
	margin-top: 2px;
	color: var( --md-sky-600 );
}

/* ---------------------------------------------------------- Install bar */

.md-install {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 13px 16px;
	margin-bottom: 18px;
	background: linear-gradient( 120deg, var( --md-navy-900 ) 0%, var( --md-navy ) 100% );
	border-radius: var( --md-radius-sm );
	color: var( --md-white );
}

.md-install[hidden] {
	display: none;
}

.md-install__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 11px;
	background: rgba( 59, 184, 255, 0.18 );
	color: var( --md-sky );
}

.md-install__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.md-install__text strong {
	color: var( --md-white ) !important;
	font-size: 14.5px;
	font-weight: 700;
}

.md-install__text small {
	color: rgba( 255, 255, 255, 0.72 ) !important;
	font-size: 12.5px;
	line-height: 1.45;
}

.md-install__text small b {
	color: var( --md-sky );
}

.md-portal .md-btn--sky {
	flex: 0 0 auto;
	padding: 10px 20px;
	background: var( --md-sky );
	color: var( --md-navy ) !important;
	font-size: 14px;
}

.md-portal .md-btn--sky:hover {
	background: var( --md-white );
}

.md-install__close {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: rgba( 255, 255, 255, 0.6 );
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.md-install__close:hover {
	background: rgba( 255, 255, 255, 0.14 );
	color: var( --md-white );
}

/* -------------------------------------------------------------- Account */

.md-account-grid {
	display: grid;
	grid-template-columns: minmax( 0, 1.15fr ) minmax( 0, 1fr );
	gap: 16px;
	align-items: start;
}

.md-account-table {
	width: 100%;
	border-collapse: collapse;
}

.md-account-table th,
.md-account-table td {
	padding: 10px 0;
	border-bottom: 1px solid var( --md-line );
	font-size: 14px;
	text-align: left;
	vertical-align: top;
}

.md-account-table th {
	width: 38%;
	color: var( --md-muted );
	font-weight: 600;
}

.md-account-table code {
	padding: 2px 8px;
	background: var( --md-navy-050 );
	border-radius: 5px;
	color: var( --md-navy );
	font-weight: 600;
}

/* ---------------------------------------------------------- Confirmation */

.md-confirm {
	max-width: 540px;
	margin: 28px auto;
	padding: 46px 36px;
	background: var( --md-white );
	border: 1px solid var( --md-line );
	border-radius: var( --md-radius );
	box-shadow: var( --md-shadow );
	text-align: center;
}

.md-confirm__icon {
	display: inline-grid;
	place-items: center;
	width: 82px;
	height: 82px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var( --md-success-bg );
	color: var( --md-success );
}

.md-portal .md-confirm__title {
	margin: 0 0 12px;
	color: var( --md-navy ) !important;
	font-size: 25px;
	font-weight: 800;
}

.md-confirm__text {
	margin-bottom: 20px;
	color: var( --md-muted );
	font-size: 15px;
}

.md-confirm__ref {
	margin-bottom: 26px;
	color: var( --md-muted );
	font-size: 13px;
}

.md-confirm__ref code {
	padding: 4px 10px;
	background: var( --md-navy-050 );
	border-radius: 6px;
	color: var( --md-navy );
	font-weight: 700;
	letter-spacing: 0.04em;
}

.md-confirm__actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ------------------------------------------------------------------ Auth */

.md-portal--auth {
	display: grid;
	place-items: center;
	min-height: 62vh;
	padding: 44px 16px;
}

.md-auth-card {
	width: 100%;
	max-width: 420px;
	padding: 38px 34px;
	background: var( --md-white );
	border: 1px solid var( --md-line );
	border-radius: var( --md-radius );
	box-shadow: var( --md-shadow );
}

.md-auth-card__brand {
	margin-bottom: 28px;
	text-align: center;
}

.md-auth-card__logo {
	display: block;
	width: auto;
	max-width: 240px;
	max-height: 58px;
	margin: 0 auto 12px;
	object-fit: contain;
}

.md-portal .md-auth-card__brand h1 {
	margin: 14px 0 4px;
	color: var( --md-navy ) !important;
	font-size: 22px;
	font-weight: 800;
}

.md-auth-card__brand p {
	color: var( --md-muted );
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

.md-auth-card .login-username,
.md-auth-card .login-password {
	margin-bottom: 16px;
}

.md-auth-card label {
	display: block;
	margin-bottom: 7px;
	color: var( --md-navy );
	font-size: 14px;
	font-weight: 600;
}

.md-auth-card input[type="text"],
.md-auth-card input[type="password"] {
	display: block;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var( --md-line );
	border-radius: var( --md-radius-sm );
	font-size: 15px;
}

.md-auth-card input[type="text"]:focus,
.md-auth-card input[type="password"]:focus {
	border-color: var( --md-sky );
	box-shadow: 0 0 0 4px rgba( 59, 184, 255, 0.18 );
	outline: none;
}

.md-auth-card .login-remember {
	margin-bottom: 18px;
	font-size: 14px;
}

.md-auth-card .login-remember label {
	display: inline;
	font-weight: 500;
}

.md-auth-card .login-submit input[type="submit"] {
	width: 100%;
	padding: 13px 20px;
	background: linear-gradient( 130deg, var( --md-navy ) 0%, var( --md-navy-700 ) 100% );
	border: 0;
	border-radius: var( --md-radius-sm );
	color: var( --md-white );
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 18px -8px rgba( 12, 31, 97, 0.7 );
}

.md-auth-card .login-submit input[type="submit"]:hover {
	transform: translateY( -1px );
}

.md-auth-card__help {
	margin-top: 18px;
	font-size: 14px;
	text-align: center;
}

.md-portal .md-auth-card__help a {
	color: var( --md-navy ) !important;
	font-weight: 600;
}

.md-portal .md-auth-card__help a:hover {
	color: var( --md-sky-600 ) !important;
}

.md-auth-card__note {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid var( --md-line );
	color: var( --md-muted );
	font-size: 13px;
	text-align: center;
}

/* ---------------------------------------------------------------- Footer */

.md-portal__footer {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 34px;
	padding-top: 20px;
	border-top: 1px solid var( --md-line );
	color: var( --md-muted );
	font-size: 12px;
}

/* --------------------------------------------------------------- Utility */

.md-screen-reader {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.md-pill {
	display: inline-block;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}

.md-pill--active {
	background: var( --md-success-bg );
	color: var( --md-success );
}

.md-pill--inactive {
	background: #eef0f5;
	color: var( --md-muted );
}

/* ---------------------------------------------------------- Small screens */

/* Laptops and small desktops. */
@media ( max-width: 1080px ) {
	.md-portal {
		padding: 22px 18px 56px;
	}

	.md-stat-row {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

/* Tablets: the header can no longer hold brand + nav + user on one line. */
@media ( max-width: 900px ) {
	.md-portal__bar {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 14px 16px;
	}

	.md-portal__brand {
		margin-right: 0;
		justify-content: center;
	}

	.md-portal__nav {
		justify-content: flex-start;
	}

	.md-portal__user {
		justify-content: center;
		padding-left: 0;
		padding-top: 12px;
		border-left: 0;
		border-top: 1px solid rgba( 255, 255, 255, 0.18 );
	}

	/* !important beats the inline structural styles set in the view. */
	.md-action-grid {
		grid-template-columns: minmax( 0, 1fr ) !important;
	}

	.md-signature-grid,
	.md-signature-grid--single {
		grid-template-columns: minmax( 0, 1fr );
	}

	.md-account-grid {
		grid-template-columns: minmax( 0, 1fr );
	}
}

/* Large phones and small tablets. */
@media ( max-width: 720px ) {
	.md-portal {
		padding: 18px 14px 48px;
	}

	.md-field-row {
		grid-template-columns: minmax( 0, 1fr );
		gap: 14px;
	}

	.md-card {
		padding: 18px;
	}

	.md-form__actions {
		position: static;
		flex-direction: column;
		align-items: stretch;
		padding: 16px 18px;
	}

	.md-form__buttons {
		flex-direction: column-reverse;
	}

	.md-portal .md-btn {
		width: 100%;
	}

	.md-confirm {
		padding: 32px 22px;
	}

	.md-portal__footer {
		flex-direction: column;
		gap: 6px;
		text-align: center;
	}

	/* Comfortable thumb target for signing on a phone. */
	.md-signature__canvas {
		height: 200px;
	}
}

/* Phones. */
@media ( max-width: 520px ) {
	.md-portal {
		padding: 14px 12px 40px;
		font-size: 15px;
	}

	.md-stat-row {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		gap: 10px;
	}

	.md-stat {
		padding: 14px 14px 14px 16px;
	}

	.md-stat__value {
		font-size: 24px;
	}

	.md-stat__label {
		font-size: 11.5px;
		line-height: 1.35;
	}

	.md-portal__logo img {
		height: 32px;
		max-width: 170px;
	}

	.md-portal .md-nav-link {
		padding: 8px 13px;
		font-size: 13px;
	}

	.md-portal .md-action-card {
		padding: 15px;
		gap: 12px !important;
	}

	.md-portal .md-action-card__icon {
		flex: 0 0 40px !important;
		width: 40px !important;
		height: 40px !important;
		border-radius: 10px;
	}

	.md-action-card__icon svg {
		width: 21px;
		height: 21px;
	}

	.md-action-card__text strong {
		font-size: 14.5px;
	}

	.md-action-card__text small {
		font-size: 12px;
	}

	.md-card {
		padding: 15px;
		border-radius: 12px;
	}

	.md-portal .md-card__title {
		margin-bottom: 16px;
		font-size: 15.5px;
	}

	.md-portal .md-input {
		padding: 11px 12px;
		/* 16px keeps iOS Safari from zooming the page on focus. */
		font-size: 16px;
	}

	.md-signature {
		padding: 12px;
	}

	.md-signature__canvas {
		height: 175px;
	}

	.md-notice {
		padding: 14px;
		gap: 10px;
	}

	.md-install {
		flex-wrap: wrap;
		padding: 12px 14px;
	}

	.md-portal .md-btn--sky {
		width: 100%;
	}

	.md-confirm__icon {
		width: 66px;
		height: 66px;
	}

	.md-portal .md-confirm__title {
		font-size: 21px;
	}

	.md-auth-card {
		padding: 28px 20px;
	}
}

/* Very small phones. */
@media ( max-width: 380px ) {
	.md-stat-row {
		grid-template-columns: minmax( 0, 1fr );
	}

	.md-portal__user-name {
		max-width: 130px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}
