/* ----------------------------------------
   GLOBAL RESETS
---------------------------------------- */
* {
	box-sizing: border-box;
}

html,
body {
	font-family: "Montserrat", sans-serif;
	font-size: 15px;
	margin: 0;
	padding: 0;
	color: var(--color01);
	min-height: 100svh; /* mobile-safe viewport height */
	display: flex;
	flex-direction: column;
	background: #eeeff0;
	padding-bottom: env(safe-area-inset-bottom); /* keep above iPhone home bar */
}

/* Form controls inherit font */
button,
input,
select,
textarea {
	font-family: inherit;
}

/* ----------------------------------------
   CSS VARIABLES
---------------------------------------- */
:root {
	--color01: rgb(64, 80, 96);
	--color01-25: rgba(64, 80, 9, 0.25);
}

/* ----------------------------------------
   LAYOUT
---------------------------------------- */
main {
	flex: 1 1 auto; /* fill vertical space */
	display: flex;
	flex-direction: column; /* column with bottom bar */
	align-items: center;
	justify-content: center;
	max-width: 393px;
	margin: 0 auto;
	padding: 20px;
	text-align: center;
}

/* Centred stack for logo, text & form */
.content {
	flex: 1; /* take remaining height */
	display: flex;
	flex-direction: column;
	justify-content: center; /* vertical centring */
	align-items: center;
	gap: 30px;
	width: 100%;
}

form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	width: 100%;
	max-width: 353px;
}

/* Bottom bar */
.buttons {
	display: flex;
	gap: 10px;
	justify-content: center;
	align-items: center;
	margin-top: 1rem; /* push to bottom of main */
	width: 100%;
	position: static; /* no absolute/fixed */
	padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.buttons .button,
.buttons button {
	flex: 1 1 0;
	width: auto; /* not full width */
	text-align: center;
}

/* ----------------------------------------
   TYPOGRAPHY
---------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	text-align: center;
	font-family: Menlo, monospace;
	font-weight: 700;
	line-height: 150%;
}

h2,
.elyvra-text {
	font-size: 1.2rem;
}

.elyvra-text {
	text-align: center;
	font-family: Menlo, monospace;
	font-weight: 700;
	line-height: 150%;
}

/* Block cursor styling */
.elyvra-text h1::after {
	content: "█"; /* full block character */
	display: inline-block;
	margin-left: 3px;
	animation: blink 1s step-start infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

.text-sm {
	font-size: 0.75rem !important;
}

/* ----------------------------------------
   LOGOS
---------------------------------------- */
#main_logo {
	width: 280px;
}

#ELYVRA_logo,
#E_logo {
	width: auto;
	height: 48px;
	display: block;
}

/* ----------------------------------------
   BUTTONS
---------------------------------------- */
button:not(.toggle-password),
.button {
	background-color: var(--color01);
	font-size: 16px;
	font-weight: 600;
	text-transform: uppercase;
	height: 44px;
	min-width: 100px;
	padding: 0 16px;
	border: none;
	color: white;
	cursor: pointer;
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0% 100%);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.buttons .button,
.buttons button {
	flex: 1 1 0;
	width: auto;
}

button.back,
.button.back {
	clip-path: polygon(10px 0, 100% 0, 100% 100%, 0% 100%, 0 10px);
	background-color: #b0c0d0;
}

.secondary {
	background-color: #b0c0d0;
}

button:hover,
.button:hover {
	opacity: 0.85;
}

.button.icon-only {
	padding: 0.5rem;
	width: auto;
	min-width: unset;
	text-align: center;
}

.button.icon-only i {
	font-size: 0.875rem;
}

.buttons {
	display: flex;
	gap: 10px;
}

.buttons .button.icon-only {
	flex: 0 0 auto; /* don't grow */
	min-width: 0; /* override the 100px min width */
	padding: 0; /* remove horizontal padding */
	width: 44px; /* same as height for a compact square */
	height: 44px; /* keeps your existing button height */
	justify-content: center;
}

.buttons .button.icon-only i {
	font-size: 16px;
	line-height: 1;
}

/* ----------------------------------------
   FORM FIELDS
---------------------------------------- */
.input-wrap {
	position: relative;
	display: inline-block;
	width: 100%;
}

.input-wrap input[type="text"],
.input-wrap input[type="email"],
.input-wrap input[type="password"],
.input-wrap input[type="number"],
.input-wrap input[type="search"],
.input-wrap input[type="tel"],
.input-wrap input[type="url"],
.input-wrap textarea {
	height: 44px;
	padding: 0 10px;
	border: 1px solid #fff;
	border-radius: 0;
	background-color: #fff;
	box-sizing: border-box;
	width: 100%;
	-webkit-appearance: none; /* iOS Safari reset */
}

.input-wrap textarea {
	height: auto;
	min-height: 80px;
	padding: 10px;
	resize: vertical;
}

/* Autofill fixes */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.input-wrap textarea:-webkit-autofill,
.input-wrap textarea:-webkit-autofill:hover,
.input-wrap textarea:-webkit-autofill:focus {
	box-shadow: 0 0 0 1000px #fff inset !important;
	-webkit-text-fill-color: var(--color01) !important;
	caret-color: var(--color01);
	border: 1px solid #fff;
	transition: background-color 9999s ease-out, color 9999s ease-out;
}

.input-wrap input:-moz-autofill,
.input-wrap textarea:-moz-autofill {
	box-shadow: 0 0 0 1000px #fff inset;
	-moz-text-fill-color: var(--color01);
	caret-color: var(--color01);
	border: 1px solid #fff;
}

/* Green triangle focus indicator (Safari supports :has) */
.input-wrap:has(input:focus)::after,
.input-wrap:has(textarea:focus)::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-top: 10px solid #90b0a0;
}

/* Remove native outlines/glows */
.input-wrap input:focus,
.input-wrap textarea:focus,
.input-wrap input:focus-visible,
.input-wrap textarea:focus-visible {
	outline: none !important;
	box-shadow: none !important;
	border-color: #fff;
}

.row {
	display: flex;
	align-items: center; /* keeps them vertically aligned */
	gap: 1rem; /* space between checkbox pill and link */
}

.forgot-link {
	margin: 0; /* remove the old margin-top */
	display: inline; /* don’t force block behaviour */
	text-align: left; /* not needed anymore but harmless */
}

/* ----------------------------------------
   CHOICE CHIPS (kept from your original)
---------------------------------------- */
ul.choice-list {
	list-style: none;
	padding: 0;
	margin: 30px 0 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	text-transform: uppercase;
	justify-content: center;
}

ul.choice-list li {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 16px;
	border-radius: 21px;
	background-color: rgba(16, 32, 48, 0.1); /* #102030 @ 10% */
	color: var(--color01-25);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
}

ul.choice-list li.on {
	background-color: #ff0000;
	color: #fff;
}

.visually-hidden {
	display: none;
}

/* Container for the password field */
.password-field {
	position: relative; /* allows absolute positioning inside */
}

/* Reset and position the toggle */
.password-field .toggle-password {
	all: unset; /* remove all default button styles */
	position: absolute;
	top: 50%;
	right: 50px; /* inside the field, right aligned */
	transform: translateY(-50%);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666; /* icon colour */
	line-height: 1;
}

/* Optional: a hover effect for better affordance */
.password-field .toggle-password:hover {
	color: #000;
}

/* Icon sizing */
.password-field .material-symbols-outlined {
	font-size: 20px;
	pointer-events: none; /* so clicks always go to the button */
}

/* Container label becomes the pill */
.checkbox-label {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px; /* keep space consistent */
	padding: 8px 15px; /* 20px left/right as requested */
	border-radius: 9999px; /* fully rounded / semi-circle ends */
	background: rgba(16, 32, 48, 0.1);
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, padding-left 0.2s ease,
		color 0.2s ease;
	font-size: 0.8rem;
	font-weight: 600;
}

.checkbox-label:hover {
	background: rgba(16, 32, 48, 0.2);
}

/* Hide the checkbox accessibly (still focusable for a11y) */
.checkbox-label > input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
}

/* Focus outline for keyboard users */
.checkbox-label > input[type="checkbox"]:focus-visible + span,
.checkbox-label:has(input[type="checkbox"]:focus-visible) {
	outline: 2px solid #d1d5db; /* neutral outline */
	outline-offset: 2px;
	border-radius: 9999px;
}

/* When ON: red background, tick appears, and a little extra left padding for the icon */
.checkbox-label:has(input[type="checkbox"]:checked) {
	background: #ef4444; /* red */
	color: #fff !important; /* make text white on red */
	padding-left: 40px; /* room for the tick at left */
}

/* Tick icon (Font Awesome) appears only when ON */
.checkbox-label::before {
	content: "";
	position: absolute;
	left: 16px;
	opacity: 0;
	transform: translateY(-50%);
	top: 50%;
	transition: opacity 0.2s ease;
	/* Font Awesome tick (solid) */
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-size: 14px;
}

/* show the tick when checked */
.checkbox-label:has(input[type="checkbox"]:checked)::before {
	content: "\f00c"; /* fa-check */
	opacity: 1;
}

/* Make sure inner text inherits the on/off colours smoothly */
.checkbox-label > span {
	transition: color 0.2s ease;
}

/* ----------------------------------------
   SMALL DEVICE TWEAKS
---------------------------------------- */
@media (max-width: 360px) {
	#main_logo {
		width: 240px;
	}
	h2,
	.elyvra-text {
		font-size: 1.1rem;
	}
}

/* ----------------------------------------
   MESSAGES
---------------------------------------- */

.error-message {
	margin: 2rem auto;
	color: red;
	font-weight: bold;
}

@keyframes shake {
	0%,
	100% {
		transform: translateX(0);
	}
	10%,
	30%,
	50%,
	70%,
	90% {
		transform: translateX(-5px);
	}
	20%,
	40%,
	60%,
	80% {
		transform: translateX(5px);
	}
}

.shake {
	animation: shake 0.5s;
}

#codeContainer {
	display: flex;
	gap: 1rem;
	margin-bottom: 2rem;
	align-items: center;
	justify-content: center;
}
#codeContainer input {
	width: 2rem;
	text-align: center;
	height: 3rem;
}
