:root {
	color-scheme: dark;	
	--panel-bg: #151922;
	--field-bg: #191E27;
	--border: #303744;
	--field-border: #3B4351;
	--text: #E8EDF7;
	--muted: #B9C0CC;
	--placeholder: #7F8999;
	--accent: #A9C8FF;
	--accent-text: #101318;
	--focus: #D0E0FF;
	--danger: #FF9C9C;
}

* {
	box-sizing: border-box;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 12px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: var(--accent-text);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: filter 160ms ease, transform 160ms ease;
}

.button:hover {
	filter: brightness(1.06);
}

.button:active {
	transform: translateY(1px);
}

.button:focus-visible,
input:focus-visible,
.close-button:focus-visible,
a:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

/* Overlay et fenêtre */
.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 24px 16px;
	overflow-y: auto;
	background: rgb(0 0 0 / 72%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 180ms ease, visibility 180ms ease;
}

.modal-overlay.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.registration-modal, .login-modal {
	width: min(100%, 460px);
	margin: auto;
	padding: 28px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--panel-bg);
	box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
	transform: translateY(10px);
	transition: transform 180ms ease;
}

.modal-overlay.is-open .registration-modal, .modal-overlay.is-open .login-modal {
    transform: translateY(0);
}

.modal-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.modal-heading h1 {
	margin: 0;
	color: var(--text);
	font-size: 1.55rem;
	line-height: 1.25;
}

.close-button {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
}

.close-button:hover {
	background: #242B37;
	color: var(--text);
}

.modal-intro {
	margin: 10px 0 22px;
	color: var(--muted);
	font-size: 0.94rem;
	line-height: 1.5;
}

.modal-divider {
	height: 1px;
	margin-bottom: 22px;
	border: 0;
	background: var(--border);
}

.form-fields {
	display: grid;
	gap: 16px;
}

.field {
	display: grid;
	gap: 7px;
}

.field label {
	color: var(--muted);
	font-size: 0.9rem;
	font-weight: 600;
}

.field input {
	width: 100%;
	min-height: 46px;
	padding: 12px 13px;
	border: 1px solid var(--field-border);
	border-radius: 8px;
	background: var(--field-bg);
	color: var(--text);
	font: inherit;
	font-size: 0.95rem;
}

.field input::placeholder {
	color: var(--placeholder);
	opacity: 1;
}

.field input:focus {
	border-color: var(--accent);
	outline: 2px solid rgb(169 200 255 / 18%);
	outline-offset: 1px;
}

.newsletter-option {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	margin-top: 20px;
	cursor: pointer;
}

.newsletter-option input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--accent);
	cursor: pointer;
}

.newsletter-copy {
	display: grid;
	gap: 5px;
}

.newsletter-copy strong {
	color: var(--text);
	font-size: 0.94rem;
	line-height: 1.4;
}

.newsletter-copy small {
	color: #9EA8B8;
	font-size: 0.83rem;
	line-height: 1.5;
}

.form-error {
	display: none;
	margin: 14px 0 0;
	color: var(--danger);
	font-size: 0.88rem;
	line-height: 1.5;
}

.form-error.is-visible {
	display: block;
}

.submit-button {
	width: 100%;
	margin-top: 22px;
}

.modal-footer {
	margin: 18px 0 0;
	color: #9EA8B8;
	font-size: 0.88rem;
	line-height: 1.5;
	text-align: center;
}

.modal-footer a {
	color: var(--accent);
	font-weight: 600;
	text-decoration: none;
}

.modal-footer a:hover {
	text-decoration: underline;
}

.privacy-note {
	margin: 16px 0 0;
	color: #8F99AA;
	font-size: 0.78rem;
	line-height: 1.5;
	text-align: center;
}

.privacy-note a {
	color: var(--muted);
}

body.modal-open {
	overflow: hidden;
}

.registration-message {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.registration-message.success {
    color: #B9E8C8;
    background: #183126;
    border: 1px solid #28553B;
}

.registration-message.error {
    color: #FFB4B4;
    background: #351F24;
    border: 1px solid #65323B;
}


.activation-message {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 700px;
    box-sizing: border-box;
    margin: 0;
    padding: 15px 45px 15px 18px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 1;
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 101;
}

.activation-message.success {
    color: #B9E8C8;
    background: #183126;
    border-color: #28553B;
}

.activation-message.error {
    color: #FFB4B4;
    background: #351F24;
    border-color: #65323B;
}

.activation-message .activation-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}

.activation-message .activation-close:hover {
    background: rgb(255 255 255 / 8%);
    opacity: 1;
}

.activation-message.is-hiding {
    opacity: 0;
    transform: translate(-50%, -6px);
    pointer-events: none;
}

@media (max-width: 520px) {
	.registration-modal {
		padding: 23px 20px;
		border-radius: 13px;
	}
	.modal-heading h1 {
		font-size: 1.35rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
	.activation-message {
        transition: none;
    }
}