/*
 * Modern theme for the whole account app, layered OVER Bootstrap 3 (Approach A).
 * Restyles the visible components (type, panels, forms, buttons, alerts, labels)
 * across every account page using Trellis tokens (tokens.css). Deliberately does
 * NOT touch Bootstrap's grid (.container/.row/.col-*), modals, or glyphicons — those
 * stay Bootstrap until a later "remove Bootstrap" pass. Loaded after Bootstrap so
 * these rules win. This file is only included by the account-app layout, so the
 * unscoped selectors only affect account pages.
 */

body {
	font-family: var(--rv-font);
	font-size: var(--rv-body-md-size);
	line-height: var(--rv-body-md-line);
	font-weight: var(--rv-weight-regular);
	color: var(--rv-text);
	background: var(--rv-bg);
	-webkit-font-smoothing: antialiased;
}

/* Logged-in account chrome (header + content area) — see layouts/account.volt */
.account-header {
	background: var(--rv-surface);
	border-bottom: 1px solid var(--rv-border);
}

.account-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 14px;
	padding-bottom: 14px;
}

.account-header__brand img {
	height: 30px;
	width: auto;
	display: block;
}

.account-header__logout {
	font-size: 14px;
	font-weight: 600;
	color: var(--rv-text-muted);
}

.account-header__logout:hover {
	color: var(--rv-text);
}

/* Breathing room for the page content (was flush against the top). */
.account-main {
	padding: 32px 0 56px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
	font-family: var(--rv-font);
	color: var(--rv-text);
	font-weight: var(--rv-weight-semi-bold);
}

h1 {
	font-size: var(--rv-heading-lg-size);
	line-height: var(--rv-heading-lg-line);
	letter-spacing: var(--rv-heading-lg-tracking);
	margin: 0 0 18px;
}

h2 {
	font-size: var(--rv-heading-md-size);
	line-height: var(--rv-heading-md-line);
	letter-spacing: var(--rv-heading-md-tracking);
}

h3,
h4,
h5 {
	font-size: var(--rv-heading-sm-size);
	line-height: var(--rv-heading-sm-line);
	letter-spacing: var(--rv-heading-sm-tracking);
}

dl {
	margin: 0;
}

dt {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--rv-text-muted);
	margin-top: 12px;
}

dt:first-child {
	margin-top: 0;
}

dd {
	margin: 2px 0 0;
	color: var(--rv-text);
}

/* Links follow Trellis Link: blue, darker and underlined on hover */
a {
	color: var(--rv-link);
	text-decoration: none;
}

a:hover {
	color: var(--rv-link-hover);
	text-decoration: underline;
	text-underline-offset: 2px;
}

a:focus-visible {
	outline: var(--rv-focus-outline);
	outline-offset: var(--rv-focus-offset);
	border-radius: 2px;
}

/* Cards (Bootstrap panels) */
.panel,
.panel-default {
	background: var(--rv-surface);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	box-shadow: var(--rv-shadow);
	margin-bottom: 20px;
}

.panel-heading {
	padding: 16px 20px;
	border-bottom: 1px solid var(--rv-border);
	background: transparent;
	border-radius: var(--rv-radius) var(--rv-radius) 0 0;
}

.panel-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0;
	color: var(--rv-text);
}

.panel-body {
	padding: 20px;
}

/* Forms */
.form-group {
	margin-bottom: 16px;
}

/*
 * Field label = Trellis Field.Label: 14/18 semi-bold, muted, 4px above its input.
 * The legacy floating labels (.input-active-label, positioned inside the input by
 * app.css and shrunk by app.js on focus) are pinned above the input instead.
 */
label,
.input > label,
.input.input-active-label > label,
.input.input-active-label.active > label {
	position: static;
	display: block;
	margin: 0 0 4px;
	font-size: 14px;
	line-height: 18px;
	font-weight: var(--rv-weight-semi-bold);
	color: var(--rv-text-muted);
	pointer-events: auto;
	transition: none;
}

/* Required marker: red asterisk right after the label text */
.form-group.required label::after {
	content: '*';
	color: var(--rv-danger);
}

/*
 * Text input = Trellis Input: 40px, white, 8px corners, faint 1px outline, 14px text.
 * Lists the legacy .input-active-label selectors because app.css styles them with
 * the same specificity (gray #fcfcfc fill, 4px corners, 44px).
 */
.form-control,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='tel'],
input[type='number'],
select,
textarea,
.input.input-active-label input,
.input.input-active-label textarea,
.input.input-active-label select,
.input.input-active-label.active input,
.input.input-active-label.active textarea,
.input.input-active-label.active select {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	font-size: var(--rv-body-md-size);
	line-height: var(--rv-body-md-line);
	color: var(--rv-text);
	background: var(--rv-surface);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius-sm);
	box-shadow: none;
	transition: background-color 0.12s ease;
}

textarea,
.input.input-active-label textarea,
.input.input-active-label.active textarea {
	height: auto;
	padding: 10px 12px;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder,
.input.input-active-label input::placeholder,
.input.input-active-label textarea::placeholder {
	color: var(--rv-text-disabled);
	opacity: 1;
}

.form-control:hover:not(:focus):not(:disabled),
input[type='text']:hover:not(:focus):not(:disabled),
input[type='email']:hover:not(:focus):not(:disabled),
input[type='password']:hover:not(:focus):not(:disabled),
input[type='tel']:hover:not(:focus):not(:disabled),
input[type='number']:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled) {
	background-color: var(--rv-surface-hover);
}

/* Focus: 2px blue outline with a 2px gap. !important beats app.css's blue glow, which is !important too. */
.form-control:focus,
input[type='text']:focus,
input[type='search']:focus,
input[type='email']:focus,
input[type='password']:focus,
input[type='tel']:focus,
input[type='number']:focus,
select:focus,
textarea:focus {
	outline: var(--rv-focus-outline);
	outline-offset: var(--rv-focus-offset);
	border-color: var(--rv-border) !important;
	box-shadow: none !important;
}

/* app.css also forces the blue glow on every select, focused or not */
select {
	border-color: var(--rv-border) !important;
	box-shadow: none !important;
}

/* Invalid field (.has-error) = Trellis Input status="error": red border, kept on focus and on selects, which the two rules above force */
.form-group.has-error .form-control,
.form-group.has-error input[type='text'],
.form-group.has-error input[type='email'],
.form-group.has-error input[type='password'],
.form-group.has-error input[type='tel'],
.form-group.has-error input[type='number'],
.form-group.has-error select,
.form-group.has-error textarea {
	border-color: var(--rv-danger) !important;
}

/*
 * Show/hide password = Trellis Input's trailing icon button: borderless 34px square
 * inside the field, 12px from its right edge, with a Lucide eye / eye-off icon
 * (password-toggle.js swaps glyphicon-eye-open / -close). Replaces the separate gray
 * addon box from password-visibility.css.
 */
.input-group:has(> .password-visibility) {
	display: block;
	position: relative;
	width: 100%;
}

.input-group:has(> .password-visibility) .form-control {
	display: block;
	float: none;
	padding-right: 46px;
	border-radius: var(--rv-radius-sm) !important;
}

.input-group-addon.password-visibility {
	position: absolute;
	right: 3px;
	bottom: 3px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	color: var(--rv-text);
	background: transparent;
	border: 0;
	border-radius: 6px;
}

.input-group-addon.password-visibility:hover {
	background-color: var(--rv-muted) !important;
}

.input-group-addon.password-visibility:active {
	background-color: var(--rv-muted-active) !important;
}

.password-visibility .toggle-password {
	display: inline-flex;
}

.password-visibility .glyphicon {
	top: 0;
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E")
		center / 16px 16px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E")
		center / 16px 16px no-repeat;
}

.password-visibility .glyphicon-eye-close {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49'/%3E%3Cpath d='M14.084 14.158a3 3 0 0 1-4.242-4.242'/%3E%3Cpath d='M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49'/%3E%3Cpath d='M14.084 14.158a3 3 0 0 1-4.242-4.242'/%3E%3Cpath d='M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

.password-visibility .glyphicon::before {
	content: none;
}

/* Phone field (intl-tel-input). app.css styles it by id, so the ids are repeated here. */
#register-phone-wrapper #phoneTextbox {
	height: 40px;
	font-size: var(--rv-body-md-size);
	background-color: var(--rv-surface);
	color: var(--rv-text);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius-sm);
}

#register-phone-wrapper > br {
	display: none;
}

/*
 * Checkbox = Trellis Checkbox: 16px box, 4px corners, gray outline; green with a
 * white check when checked. Its label is regular 14/18 text 8px to the right
 * (4px margin plus the space between the two tags).
 */
input[type='checkbox'] {
	-webkit-appearance: none;
	appearance: none;
	flex: none;
	width: 16px;
	height: 16px;
	margin: 0;
	vertical-align: -3px;
	cursor: pointer;
	background: var(--rv-surface) center / 16px 16px no-repeat;
	border-radius: 4px;
	box-shadow: inset 0 0 0 1px var(--rv-control-border);
}

input[type='checkbox']:hover {
	box-shadow: inset 0 0 0 1.5px var(--rv-control-border);
}

input[type='checkbox']:checked {
	background-color: var(--rv-primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12 L9 17 L20 6'/%3E%3C/svg%3E");
	box-shadow: none;
}

input[type='checkbox']:checked:hover {
	background-color: var(--rv-primary-hover);
}

input[type='checkbox']:focus-visible {
	outline: var(--rv-focus-outline);
	outline-offset: var(--rv-focus-offset);
}

input[type='checkbox']:disabled {
	cursor: not-allowed;
	background-color: var(--rv-surface-hover);
	box-shadow: inset 0 0 0 1px var(--rv-muted);
}

input[type='checkbox'] + label {
	display: inline;
	margin: 0 0 0 4px;
	font-weight: var(--rv-weight-regular);
	color: var(--rv-text);
	cursor: pointer;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: auto;
	padding: 10px 16px;
	font-family: var(--rv-font);
	font-size: var(--rv-body-md-size);
	line-height: var(--rv-body-md-line);
	font-weight: var(--rv-weight-medium);
	border-radius: var(--rv-radius-sm);
	border: 0;
	box-shadow: none;
	transition:
		background-color 0.12s ease,
		color 0.12s ease;
}

.btn:focus,
.btn:active:focus {
	outline: none;
}

.btn:focus-visible {
	outline: var(--rv-focus-outline);
	outline-offset: var(--rv-focus-offset);
	box-shadow: none;
}

/* Trellis has one 40px button size; app.css made .btn-lg a 46px pill */
.btn-lg,
.btn-primary.btn-lg,
.btn-success.btn-lg {
	padding: 10px 16px;
	border-radius: var(--rv-radius-sm);
}

.btn-sm {
	padding: 6px 12px;
}

.btn-block {
	width: 100%;
	display: flex;
}

.btn-success,
.btn-primary {
	background: var(--rv-primary);
	border-color: var(--rv-primary);
	color: var(--rv-primary-contrast);
}

.btn-success:hover,
.btn-success:focus,
.btn-primary:hover,
.btn-primary:focus {
	background: var(--rv-primary-hover);
	border-color: var(--rv-primary-hover);
	color: var(--rv-primary-contrast);
}

.btn-success:active,
.btn-primary:active {
	background: var(--rv-primary-active);
	border-color: var(--rv-primary-active);
	color: var(--rv-primary-contrast);
}

/*
 * Secondary = Trellis intent="secondary": muted neutral fill, no border.
 * :focus restates the resting fill so a clicked button does not keep a hover color
 * (and does not fall back to Bootstrap's grey :focus); keyboard focus gets the ring.
 */
.btn-default,
.btn-default:focus,
.btn-secondary,
.btn-secondary:focus {
	background: var(--rv-muted);
	border-color: transparent;
	color: var(--rv-text);
}

.btn-default:focus-visible,
.btn-secondary:focus-visible {
	outline: var(--rv-focus-outline);
	outline-offset: var(--rv-focus-offset);
	box-shadow: none;
}

.btn-default:hover,
.btn-secondary:hover {
	background: var(--rv-muted-hover);
	border-color: transparent;
	color: var(--rv-text);
}

/* Beats Bootstrap's two-pseudo-class :active:hover / :active:focus greys */
.btn-default:active,
.btn-default:active:hover,
.btn-default:active:focus,
.btn-secondary:active,
.btn-secondary:active:hover,
.btn-secondary:active:focus {
	background: var(--rv-muted-active);
	border-color: transparent;
	color: var(--rv-text);
}

.btn-danger {
	background: var(--rv-danger);
	border-color: var(--rv-danger);
	color: #fff;
}

/* Quiet, borderless action — for the least-important control in a group (e.g. Logout). */
.btn-ghost {
	background: transparent;
	border-color: transparent;
	color: var(--rv-text);
}

.btn-ghost:hover,
.btn-ghost:focus {
	background: var(--rv-surface-hover);
	color: var(--rv-text);
}

/* Trellis tertiary small: 8px side padding instead of 12px */
.btn-ghost.btn-sm {
	padding-left: 8px;
	padding-right: 8px;
}

/* Space out grouped buttons (Bootstrap joins them; a modern gap reads cleaner). */
.btn-group {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Alerts */
.alert {
	border-radius: var(--rv-radius-sm);
	padding: 11px 14px;
	margin-bottom: 16px;
	font-size: var(--rv-body-md-size);
	line-height: var(--rv-body-md-line);
	border: 1px solid transparent;
}

.alert-danger {
	background: var(--rv-danger-surface);
	border-color: var(--rv-danger-border);
	color: var(--rv-danger-strong);
}
.alert-success {
	background: var(--rv-success-surface);
	border-color: var(--rv-success-border);
	color: var(--rv-success-strong);
}
.alert-info {
	background: var(--rv-info-surface);
	border-color: var(--rv-info-border);
	color: var(--rv-info-strong);
}
.alert-warning {
	background: var(--rv-warning-surface);
	border-color: var(--rv-warning-border);
	color: var(--rv-warning-strong);
}

/* Labels / badges */
.label {
	display: inline-block;
	padding: 3px 9px;
	font-size: 12px;
	font-weight: 600;
	border-radius: var(--rv-radius-pill);
	line-height: 1.4;
}

.label-success,
.label-primary {
	background: var(--rv-success-surface);
	color: var(--rv-primary-hover);
}
.label-danger {
	background: var(--rv-danger-surface);
	color: var(--rv-danger);
}
.label-default {
	background: var(--rv-bg);
	color: var(--rv-text-muted);
}
