/*
 * Oriel — shared controls (Oriel Online design pack v2, handoff/oriel-controls.css).
 * Loaded after the theme stylesheet. <html> carries .oriel-ui with
 * data-theme (journal | golden-hour | astral-atlas) and data-mode (light | dark);
 * each theme stylesheet sets the --o-* colour tokens for both modes, and the
 * handoff token names below read from them.
 *
 * .oriel-form wraps the login, registration and password-recovery forms. Email,
 * text, password and search inputs (and selects) share one box: 48px high,
 * full width of the form, 1px border, 8px radius, 16px text, 14px inline
 * padding. A revealed password is type="text", so it keeps the same box.
 */
.oriel-ui {
	--canvas: var(--o-canvas);
	--surface: var(--o-surface);
	--ink: var(--o-text);
	--muted: var(--o-text-2);
	--line: var(--o-border);
	--field-line: var(--o-input-border);
	--field: var(--o-input-bg);
	--action: var(--o-action);
	--action-ink: var(--o-on-action);
	--link: var(--o-link);
	--focus: var(--o-focus);
	--control-height: 48px;
	--control-radius: 8px;
}
.oriel-ui[data-mode="light"] { color-scheme: light; }
.oriel-ui[data-mode="dark"] { color-scheme: dark; }

/* ---------- Forms ---------- */
.oriel-form { display: block; width: 100%; min-width: 0; margin: 0; }
.oriel-form .form-group { margin: 0 0 18px; min-width: 0; }
.oriel-form .form-group > label,
.oriel-form .form-label {
	display: block; margin: 0 0 8px; padding: 0;
	font-family: var(--o-font-body); font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink);
}
.oriel-form input[type="email"],
.oriel-form input[type="text"],
.oriel-form input[type="password"],
.oriel-form input[type="search"],
.oriel-form select {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	height: var(--control-height);
	min-height: var(--control-height);
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--field-line);
	border-radius: var(--control-radius);
	background: var(--field);
	color: var(--ink);
	font-family: var(--o-font-body);
	font-size: 16px;
	line-height: normal;
	box-shadow: none;
}
.oriel-form select { padding-right: 36px; }
.oriel-form input::placeholder { color: var(--muted); opacity: 1; }
.oriel-form input:focus-visible,
.oriel-form select:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
	border-color: var(--focus);
	box-shadow: none;
}
.oriel-form input[aria-invalid="true"] { border-color: var(--o-error); box-shadow: inset 0 0 0 1px var(--o-error); }

/* Wrappers add no border or padding of their own. */
.oriel-form .input-field { position: relative; display: block; width: 100%; min-width: 0; }
.oriel-form .input-field__icon {
	position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
	width: 20px; height: 20px; color: var(--muted); pointer-events: none;
}
.oriel-form .has-icon input { padding-left: 46px; }
.oriel-form .password-field input { padding-right: 56px; }
.oriel-form .password-toggle {
	position: absolute; top: 2px; right: 2px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0;
	border: 0; border-radius: 6px;
	background: transparent; color: var(--ink);
	cursor: pointer;
}
.oriel-form .password-toggle[hidden] { display: none; }
.oriel-form .password-toggle .o-icon { width: 22px; height: 22px; }
.oriel-form .password-toggle .password-toggle__hide,
.oriel-form .password-toggle[aria-pressed="true"] .password-toggle__show { display: none; }
.oriel-form .password-toggle[aria-pressed="true"] .password-toggle__hide { display: block; }
.oriel-form .password-toggle:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.oriel-form .password-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }

.oriel-form .submit-button {
	display: flex; align-items: center; justify-content: center;
	width: 100%;
	min-height: var(--control-height);
	margin: 4px 0 0;
	padding: 8px 18px;
	border: 1px solid var(--action);
	border-radius: var(--control-radius);
	background: var(--action);
	color: var(--action-ink);
	font-family: var(--o-font-body);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}
.oriel-form .submit-button:hover { filter: brightness(1.08); }
.oriel-form .submit-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.oriel-form .form-links {
	display: flex; flex-wrap: wrap; justify-content: space-between;
	gap: 10px 16px; margin: 16px 0 0;
	font-size: 15px;
}
.oriel-form .form-links:has(> a:only-child) { justify-content: center; }
.oriel-form .form-links a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.oriel-form .o-help { margin: 6px 0 0; }

/* Two fields side by side (registration). */
.oriel-form .form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.oriel-form .form-row > .o-help, .oriel-form .form-row > .o-rules { grid-column: 1 / -1; margin: -8px 0 18px; }

/* Radio choices, date selects and captcha keep their own sizes. */
.oriel-form .o-fieldset { margin: 0 0 18px; }
.oriel-form .o-choice { display: inline-flex; margin: 0; font-weight: 400; }
.oriel-form .o-date select { display: inline-block; width: auto; min-width: 96px; }
.oriel-form .security-code + input { margin-top: 8px; }

/* ---------- Footer ---------- */
.oriel-footer {
	margin-top: 36px;
	padding: 20px 16px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	text-align: center;
	font-size: 14px;
	line-height: 1.6;
}
.oriel-footer .footer-row {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
	gap: 4px 8px;
}
.oriel-footer p { margin: 8px 0 0; }
.oriel-footer a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 600px) {
	.oriel-footer { padding-inline: 16px; }
	.oriel-form .form-links { justify-content: flex-start; }
	.oriel-form .form-row { grid-template-columns: minmax(0, 1fr); }
}
