/*
 * Rhythm Portal: front-end styles.
 *
 * Fonts come from the theme. Colours, button shape and hover behaviour come
 * from Rhythm Portal → Settings → Brand style, which prints these variables
 * in the page head, so the portal matches the rest of the site. Anything set
 * in a module's Design tab in Divi still wins.
 */
:root {
	--rhp-accent: #058ca4;
	--rhp-accent-contrast: #fff;
	--rhp-btn-radius: 8px;
	--rhp-btn-transform: uppercase;
	--rhp-btn-spacing: 1px;
	--rhp-btn-weight: 900;
	--rhp-btn-size: 14px;
	--rhp-btn-padding: 10px 30px;
	--rhp-hover-bg: #fff;
	--rhp-hover-text: var(--rhp-accent);
	--rhp-hover-border: var(--rhp-accent);
	--rhp-text: inherit;
	--rhp-heading: #1b1b1b;
	--rhp-muted: #646970;
	--rhp-border: #e5e7eb;
	--rhp-surface: #fff;
	--rhp-soft: #f3f4f6;
	--rhp-field-bg: #f3f4f6;
	--rhp-field-border: #d1d5db;
	--rhp-radius: 10px;
	--rhp-shadow: 0 2px 18px rgba(0, 0, 0, 0.08);
	--rhp-ok: #1a7f37;
	--rhp-error: #b32d2e;
}

.rhp-card {
	background: var(--rhp-surface);
	border-radius: var(--rhp-radius);
	box-shadow: var(--rhp-shadow);
	padding: clamp(24px, 4vw, 40px);
	box-sizing: border-box;
}

.rhp-login {
	max-width: 480px;
	margin-left: auto;
	margin-right: auto;
}

.rhp-title {
	margin: 0 0 0.5em;
	padding: 0;
	line-height: 1.2;
}

.rhp-intro {
	margin: 0 0 1.25em;
	padding: 0;
}

.rhp-form p {
	margin: 0 0 1em;
	padding: 0;
}

.rhp-field label {
	display: block;
	margin-bottom: 0.4em;
	font-weight: 600;
	color: var(--rhp-heading);
}

/* Matches the site's form fields (light grey, thin border, rounded). Firm,
   because Divi and form plugins style every input on the page. */
.rhp-field input[type="email"],
.rhp-field input[type="password"],
.rhp-field input[type="text"] {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	min-height: 48px;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 12px 14px !important;
	font-family: inherit !important;
	font-size: 16px !important;
	line-height: 1.4 !important;
	color: rgba(0, 0, 0, 0.75) !important;
	background: var(--rhp-field-bg) !important;
	border: 1px solid var(--rhp-field-border) !important;
	border-radius: var(--rhp-btn-radius) !important;
	box-shadow: none !important;
}

.rhp-field input[type="email"]:focus,
.rhp-field input[type="password"]:focus,
.rhp-field input[type="text"]:focus {
	outline: 2px solid color-mix(in srgb, var(--rhp-accent) 45%, transparent) !important;
	outline-offset: 1px;
	border-color: var(--rhp-accent) !important;
	background: #fff !important;
}

.rhp-remember label {
	display: inline-flex;
	gap: 0.5em;
	align-items: center;
	font-weight: 400;
}

/* Honeypot: invisible to people, still in the form for bots. */
.rhp-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/*
 * Buttons follow the site's button style (Brand style settings). They are
 * stated firmly (!important) because Divi's own ".et_pb_button" rules,
 * including a near-transparent hover background, would otherwise win. A
 * button styled in a module's Design tab uses Divi's stronger selectors and
 * still takes precedence.
 */
.rhp-button,
a.rhp-button,
button.rhp-button {
	display: inline-block;
	cursor: pointer;
	text-align: center;
	text-decoration: none !important;
	background: var(--rhp-accent) !important;
	color: var(--rhp-accent-contrast) !important;
	border: 2px solid var(--rhp-accent) !important;
	border-radius: var(--rhp-btn-radius) !important;
	padding: var(--rhp-btn-padding) !important;
	font-family: inherit;
	font-size: var(--rhp-btn-size) !important;
	font-weight: var(--rhp-btn-weight) !important;
	text-transform: var(--rhp-btn-transform) !important;
	letter-spacing: var(--rhp-btn-spacing) !important;
	line-height: 1.7 !important;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rhp-button:hover,
.rhp-button:focus,
.rhp-button:focus-visible,
.rhp-button:active {
	background: var(--rhp-hover-bg) !important;
	color: var(--rhp-hover-text) !important;
	border-color: var(--rhp-hover-border) !important;
	padding: var(--rhp-btn-padding) !important;
	filter: none;
	opacity: 1;
}

.rhp-button:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--rhp-accent) 40%, transparent);
	outline-offset: 2px;
}

/* Divi adds an arrow icon on hover to .et_pb_button; keep portal buttons calm. */
.rhp-button.et_pb_button:after,
.rhp-button.et_pb_button:before {
	display: none !important;
}

.rhp-submit .rhp-button {
	width: 100%;
}

.rhp-link {
	color: var(--rhp-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rhp-link:hover,
.rhp-link:focus {
	color: color-mix(in srgb, var(--rhp-accent) 75%, #000);
}

.rhp-alt {
	text-align: center;
	margin-top: 0.5em;
}

.rhp-sep {
	margin: 0 0.5em;
	color: var(--rhp-muted);
}

.rhp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em 1em;
	align-items: center;
}

.rhp-notice,
.rhp-error {
	padding: 12px 14px;
	border-radius: var(--rhp-btn-radius);
	margin: 0 0 1.25em;
	border-left: 4px solid var(--rhp-ok);
	background: rgba(26, 127, 55, 0.08);
}

.rhp-error {
	border-left-color: var(--rhp-error);
	background: rgba(179, 45, 46, 0.08);
}

.rhp-muted,
.rhp-empty {
	color: var(--rhp-muted);
}

.rhp-editor-hint {
	border: 1px dashed var(--rhp-border);
	border-radius: 6px;
	padding: 12px 14px;
	font-size: 0.9em;
}

/* ---------------------------------------------------------------- badges */

.rhp-badge {
	display: inline-block;
	font-size: 0.75em;
	line-height: 1.2;
	padding: 0.3em 0.7em;
	border-radius: 999px;
	background: var(--rhp-soft);
	color: var(--rhp-muted);
	margin: 0 0.35em 0.35em 0;
	white-space: nowrap;
}

.rhp-badge-zone {
	background: color-mix(in srgb, var(--rhp-accent) 12%, transparent);
	color: var(--rhp-accent);
	font-weight: 600;
}

/* ------------------------------------------------------------- resources */

.rhp-resources > .rhp-title {
	margin-bottom: 0.4em;
}

/*
 * A resource list that follows text on the same page (a page written in
 * the block editor, e.g. "…talk to your BCBA." then "Learn more") gets room
 * above it, and so do the cards under its heading. In Divi each module has
 * its own wrapper, so this never adds to Divi's own spacing.
 */
* + .rhp-resources {
	margin-top: 2.25em;
}

.rhp-resources > .rhp-title + .rhp-resource-list {
	margin-top: 1em;
}

.rhp-resource-list {
	display: grid;
	gap: 20px;
	grid-template-columns: 1fr;
}

.rhp-cols-2 .rhp-resource-list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rhp-cols-3 .rhp-resource-list {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 767px) {
	.rhp-cols-2 .rhp-resource-list,
	.rhp-cols-3 .rhp-resource-list {
		grid-template-columns: 1fr;
	}
}

/*
 * Divi wraps each card in two boxes (.et_pb_module > .et_pb_module_inner).
 * Pass the row height down through both so every card in a row is equally
 * tall, with its button on the bottom edge.
 */
.rhp-resource-list > .et_pb_module {
	margin: 0 !important;
	display: flex;
	flex-direction: column;
}

.rhp-resource-list > .et_pb_module > .et_pb_module_inner {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.rhp-resource-list .rhp-resource {
	flex: 1 1 auto;
}

.rhp-resource-list > :empty {
	display: none;
}

.rhp-resource {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 16px;
	align-items: center;
	padding: 20px 22px;
	background: var(--rhp-surface);
	border-radius: var(--rhp-radius);
	box-shadow: var(--rhp-shadow);
	height: 100%;
	box-sizing: border-box;
}

.rhp-cols-2 .rhp-resource,
.rhp-cols-3 .rhp-resource {
	grid-template-columns: auto 1fr;
	grid-template-rows: 1fr auto;
	align-items: start;
}

.rhp-cols-2 .rhp-resource-button,
.rhp-cols-3 .rhp-resource-button {
	grid-column: 1 / -1;
	justify-self: start;
	align-self: end;
}

.rhp-resource-icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: var(--rhp-btn-radius);
	background: color-mix(in srgb, var(--rhp-accent) 10%, transparent);
	color: var(--rhp-accent);
}

.rhp-resource-title {
	margin: 0;
	padding: 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--rhp-heading);
}

.rhp-resource-title a {
	color: inherit;
	text-decoration: none;
}

.rhp-resource-title a:hover,
.rhp-resource-title a:focus {
	text-decoration: underline;
}

.rhp-resource-desc {
	margin: 0.25em 0 0;
	padding: 0;
	font-size: 0.95em;
}

.rhp-resource-meta {
	margin: 0.5em 0 0;
	padding: 0;
	line-height: 1;
}

.rhp-resource-meta:empty {
	display: none;
}

@media (max-width: 600px) {
	.rhp-resource {
		grid-template-columns: auto 1fr;
	}

	.rhp-resource-button {
		grid-column: 1 / -1;
		justify-self: start;
	}
}

/* ----------------------------------------------------------- account bar */

.rhp-account-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px 16px;
	padding: 12px 18px;
	background: var(--rhp-soft);
	border-radius: var(--rhp-btn-radius);
	margin-bottom: 1.75em;
}

.rhp-account-name {
	font-weight: 600;
	margin-right: 0.5em;
}

.rhp-account-who .rhp-badge {
	margin-bottom: 0;
}

/* ----------------------------------------------------------- portal button */

.rhp-align-left {
	text-align: left;
}

.rhp-align-center {
	text-align: center;
}

.rhp-align-right {
	text-align: right;
}

/* -------------------------------------------------------------- handbooks */

.rhp-progress {
	height: 8px;
	border-radius: 999px;
	background: var(--rhp-soft);
	overflow: hidden;
}

.rhp-progress span {
	display: block;
	height: 100%;
	background: var(--rhp-accent);
	border-radius: inherit;
}

.rhp-progress-text {
	margin: 0.4em 0 1em;
	padding: 0;
	font-size: 0.9em;
	color: var(--rhp-muted);
}

.rhp-handbook-list {
	list-style: none !important;
	margin: 0 0 1.5em !important;
	padding: 0 !important;
}

.rhp-handbook {
	display: grid;
	grid-template-columns: 28px 1fr auto;
	gap: 10px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--rhp-border);
}

.rhp-handbook-check {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid var(--rhp-border);
	font-size: 14px;
	line-height: 1;
}

.rhp-handbook.is-done .rhp-handbook-check {
	background: var(--rhp-accent);
	border-color: var(--rhp-accent);
	color: #fff;
}

.rhp-handbook-status {
	font-size: 0.85em;
	color: var(--rhp-muted);
}

/* ------------------------------------------------------------- no access */

.rhp-no-access-wrap {
	padding: 60px 0;
}

.rhp-no-access {
	max-width: 620px;
	margin: 0 auto;
}

/* ------------------------------------------------------------- my account */

.rhp-account {
	max-width: 960px;
	margin-left: auto;
	margin-right: auto;
}

.rhp-account-head {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 20px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--rhp-border);
}

.rhp-avatar {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--rhp-accent);
	color: var(--rhp-accent-contrast);
	font-weight: 700;
	font-size: 20px;
	letter-spacing: 0.5px;
}

.rhp-account-fullname {
	font-size: 1.25em;
	font-weight: 700;
	color: var(--rhp-heading);
	line-height: 1.3;
}

.rhp-account-email {
	color: var(--rhp-muted);
	word-break: break-word;
}

.rhp-account-badges {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.rhp-account-badges .rhp-badge {
	margin: 0;
}

.rhp-account-layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.rhp-account-nav ul {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.rhp-account-nav li {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

.rhp-tab {
	display: block;
	padding: 10px 14px;
	border-radius: var(--rhp-btn-radius);
	color: var(--rhp-heading);
	font-weight: 600;
	text-decoration: none !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.rhp-tab:hover,
.rhp-tab:focus-visible {
	background: var(--rhp-soft);
	color: var(--rhp-accent);
}

.rhp-tab.is-active {
	background: var(--rhp-accent);
	color: var(--rhp-accent-contrast);
}

.rhp-tab-link {
	font-weight: 500;
}

.rhp-account-nav li:has(.rhp-tab-signout) {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--rhp-border);
}

.rhp-tab-signout {
	color: var(--rhp-muted);
	font-weight: 500;
}

.rhp-panel-title {
	margin: 0 0 0.75em;
	padding: 0;
	font-size: 1.35em;
	line-height: 1.25;
	color: var(--rhp-heading);
}

.rhp-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin: 0 0 24px;
	padding: 16px;
	background: var(--rhp-soft);
	border-radius: var(--rhp-btn-radius);
}

.rhp-facts dt {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--rhp-muted);
	margin: 0;
}

.rhp-facts dd {
	margin: 2px 0 0;
	font-weight: 600;
	color: var(--rhp-heading);
}

.rhp-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}

.rhp-help {
	color: var(--rhp-muted);
	font-size: 0.9em;
	margin-top: -0.25em;
}

.rhp-account-panel .rhp-handbooks {
	margin: 0;
}

@media (max-width: 767px) {
	.rhp-account-layout {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.rhp-account-nav ul {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.rhp-account-nav li:has(.rhp-tab-signout) {
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
	}

	.rhp-tab {
		padding: 8px 12px;
		background: var(--rhp-soft);
	}

	.rhp-field-row {
		grid-template-columns: 1fr;
	}
}

/* -------------------------------------------------------- member dashboard */

.rhp-dash {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	max-width: 1200px;
	margin: 0 auto;
	padding: 48px 20px 64px;
	box-sizing: border-box;
}

.rhp-dash-side {
	position: sticky;
	top: 24px;
	background: var(--rhp-surface);
	border-radius: var(--rhp-radius);
	box-shadow: var(--rhp-shadow);
	padding: 20px 16px;
	box-sizing: border-box;
}

.admin-bar .rhp-dash-side {
	top: 56px;
}

.rhp-dash-user {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 4px 16px;
	margin-bottom: 12px;
	border-bottom: 1px solid var(--rhp-border);
}

.rhp-dash-user .rhp-avatar {
	width: 48px;
	height: 48px;
	font-size: 17px;
}

.rhp-dash-name {
	font-weight: 700;
	color: var(--rhp-heading);
	line-height: 1.3;
	word-break: break-word;
}

.rhp-dash-nav ul {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rhp-dash-nav li {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

.rhp-dash-link {
	display: block;
	padding: 10px 12px;
	border-radius: var(--rhp-btn-radius);
	color: var(--rhp-heading);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.rhp-dash-link:hover,
.rhp-dash-link:focus-visible {
	background: var(--rhp-soft);
	color: var(--rhp-accent);
}

.rhp-dash-link.is-active {
	background: var(--rhp-accent);
	color: var(--rhp-accent-contrast);
}

.rhp-dash-nav .rhp-dash-sub {
	margin: 2px 0 4px 12px !important;
	padding-left: 10px !important;
	border-left: 2px solid var(--rhp-border);
}

.rhp-dash-sub .rhp-dash-link {
	font-weight: 500;
	padding: 8px 10px;
	font-size: 0.95em;
}

.rhp-dash-sub .rhp-dash-link.is-active {
	background: var(--rhp-soft);
	color: var(--rhp-accent);
}

.rhp-dash-divider {
	height: 1px;
	background: var(--rhp-border);
	margin: 10px 4px !important;
}

.rhp-dash-signout {
	color: var(--rhp-muted);
	font-weight: 500;
}

/* Divi's own page title (on pages not built with Divi) would repeat the
   heading inside the dashboard. */
.rhp-has-dashboard #left-area > article > .main_title,
.rhp-has-dashboard .et_pb_post > .main_title,
.rhp-has-dashboard article.page > h1.entry-title {
	display: none;
}

.rhp-has-dashboard #main-content .container:has(.rhp-dash) {
	width: 100%;
	max-width: 1240px;
	padding-top: 0;
}

/* The page's own Divi layout fills the main column. */
.rhp-dash-main {
	min-width: 0;
}

.rhp-dash-main .et_pb_section {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	background-color: transparent;
}

.rhp-dash-main .et_pb_row {
	width: 100% !important;
	max-width: none !important;
	padding-top: 0 !important;
}

.rhp-dash-main .et_pb_section + .et_pb_section {
	margin-top: 32px;
}

.rhp-dash-main > :first-child h1:first-child,
.rhp-dash-main .et_pb_text:first-child h1 {
	margin-top: 0;
}

/* My Account inside the dashboard: tabs across the top. */
.rhp-account-compact {
	max-width: none;
}

.rhp-tabs-bar ul {
	list-style: none !important;
	margin: 0 0 24px !important;
	padding: 0 0 12px !important;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	border-bottom: 1px solid var(--rhp-border);
}

.rhp-tabs-bar li {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

.rhp-tabs-bar .rhp-tab {
	padding: 8px 16px;
}

@media (max-width: 980px) {
	.rhp-dash {
		grid-template-columns: 1fr;
		gap: 20px;
		padding-top: 24px;
	}

	.rhp-dash-side {
		position: static;
		padding: 16px;
	}

	.rhp-dash-user {
		padding-bottom: 12px;
	}

	.rhp-dash-nav > ul {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 6px;
	}

	.rhp-dash-nav > ul > li > .rhp-dash-link {
		background: var(--rhp-soft);
		padding: 8px 12px;
	}

	.rhp-dash-nav > ul > li > .rhp-dash-link.is-active {
		background: var(--rhp-accent);
	}

	.rhp-dash-nav .rhp-dash-sub {
		display: flex;
		flex-direction: row !important;
		flex-wrap: wrap;
		gap: 6px;
		margin: 0 !important;
		padding: 0 !important;
		border: 0;
	}

	.rhp-dash-nav > ul > li:has(> .rhp-dash-sub) {
		flex-basis: 100%;
	}

	.rhp-dash-sub .rhp-dash-link {
		background: var(--rhp-soft);
		padding: 6px 12px;
	}

	.rhp-dash-divider {
		display: none;
	}
}

/* Screen-reader-only text (themes usually define this; kept here too). */
.rhp-resource .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
