*, ::after, ::before {
    box-sizing: border-box;
    background-repeat: no-repeat;
}

:root {
	--pico-font-size: 1rem;
	--pico-form-label-font-weight: 500;
	/*--pico-spacing: 0.5rem;*/
	--pico-focus-icon-color: #0168ad;

}

/* Light color scheme (Default) */
/* Can be forced with data-theme="light" */
[data-theme="light"],
:root:not([data-theme="dark"]) {
	--pico-tooltip-background-color: #FFBF00;
	--pico-tooltip-color: #000;
}

/* Removes MS Edge reveal/clear icons for text/password input */
input::-ms-reveal,
input::-ms-clear {
	display: none;
}

/* fix picoCSS for disabled items */
[aria-disabled="true"], [disabled], .forbidden {
	pointer-events: unset;
	cursor: not-allowed;
}

.forbidden:not(.active) {
	opacity: 0.5;
}

.login-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100vh;
	padding: 0 1rem;
	gap: 2rem;
}

.login-form {
	background: linear-gradient(135deg, #e0e4ff 0%, #f8fafc 100%);
	padding: 1.5rem 2rem;
	border-radius: 1rem;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
	max-width: 480px;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	margin-bottom: 5rem;
}

.logo {
	width: 400px;
	height: auto;
	/*margin-bottom: 1.5rem;*/
}

button.toast-close {
	font-family: monospace;
	margin-bottom: auto;
	margin-left: 1rem;
}

#profile-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1rem;
	max-width: 600px;
	width: 100%;
	margin: auto;
}

#profile-form label {
	margin-left: 0.5rem;
}

#profile-actions {
	grid-column: 1 / 3;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
}

@media (max-width: 600px) {
	#profile-form {
		grid-template-columns: 1fr;
	}
	#profile-actions {
		grid-column: 1;
	}
}

#profile-submit {
	margin: 0;
	width: auto;
}

#profile-close {
	margin: 0;
	width: auto;
}

#logout-btn {
	margin: 0;
	width: auto;
}

#intro-screen {
	padding: 2rem;
}

#profile-screen {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 2rem 1rem;
}

.input-icon-wrapper {
	display: flex;
	align-items: center;
}



.input-icon-wrapper .icon {
	color: var(--pico-muted-color);
	pointer-events: none;
	font-size: 1rem;
	margin-bottom: var(--pico-spacing);
}

.input-icon-wrapper .icon.left {
	margin-left: 0.8rem;
	z-index: 1;
}

.input-icon-wrapper button.reveal {
	margin-left: -3.2rem;
	background: none;
	border: none;
	/*outline: none;
	box-shadow: none;*/
	margin-bottom: var(--pico-spacing);
	color: var(--pico-muted-color);
}

/* État focus pour l'icône */
/*.input-icon-wrapper input:focus+.icon {*/
.input-icon-wrapper:has(input:focus) .icon {
	color: var(--pico-primary);
}

.input-icon-wrapper:has(.icon.left) input {
	margin-left: -1.8rem;
	padding-left: 2.5rem;
}

.input-icon-wrapper:has(.reveal) input {
	padding-right: 3.2rem;
}

img[role="button"] {
	cursor: pointer;
	background-color: unset;
	border: none;
	outline: none;
	box-shadow: none;
	padding: 0;
}

body {
	/*max-width: 960px;
	margin: auto;*/
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin: 0;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	font-size: 1rem;
	/*background: linear-gradient(rgb(23, 37, 84), rgb(30, 58, 138), rgb(30, 64, 175));*/
	/*background-color: #f0f0f0;*/
	background-color: #f8fafc;
	background: linear-gradient(315deg, #e0e7ff 0%, #f8fafc 100%);
	background: linear-gradient(to bottom, rgb(23, 37, 84), rgb(30, 58, 138), rgb(30, 64, 175));
}

body hr {
	background: rgb(23, 37, 84);
    height: 1px;
    border: 0;
}

footer aside {
	text-align: right;
	font-size: 0.75rem;
	color:rgb(23, 37, 84);
	margin-top: -2.25rem;
}

footer p#copyright {
	color: #5b7bff;
}

body.login {
	background: linear-gradient(315deg, #e0e7ff 0%, #f8fafc 100%);
}

header, body>header {
	background-color: white;
	border-bottom: 1px solid #ddd;
	padding:0;

	display: flex	;
	justify-content: center;
	padding-left: 2rem;
	padding-right: 2rem;
	position: sticky;
	top: 0;
	z-index: 1000;
}

.header-content {
	flex-grow: 1;
	max-width: 1200px;
	margin: auto;
	display: flex;
	justify-content: space-between;
	padding-top: 1rem;
	/*padding-left: 2rem;
	padding-right: 2rem;*/
}

.header-content .screen-title {
	margin-top: 0;
	display: flex;
	align-items: center;
	flex-direction: column;
	/*padding-left: 1rem;*/
}

.header-content.profile {
	justify-content: space-evenly;
	gap: 1rem;
	max-width: 1200px;
}

.header-content-left p {
	margin-top: 0.25rem;
}

.header-content-right-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.5rem;
}

.header-content-right {
	flex-wrap: nowrap;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.header-credits {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	color: #666;
	font-weight: 500;
}

.header-credits i {
	color: #f59e0b;
}

/* Org switcher (menu custom) dans le header */
.org-switcher {
	position: relative;
}

.org-switcher-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.75rem;
	border: 1px solid rgba(23, 37, 84, 0.18);
	border-radius: 0.6rem;
	background: #fff;
	color: rgb(23, 37, 84);
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.1;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
	cursor: pointer;
}

.org-switcher-button:hover {
	border-color: rgba(23, 37, 84, 0.35);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
}

.org-switcher-button:focus {
	outline: none;
	border-color: #0168ad;
	box-shadow: 0 0 0 3px rgba(1, 104, 173, 0.18), 0 2px 10px rgba(0, 0, 0, 0.09);
}

.org-switcher-label {
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.org-switcher-chevron {
	opacity: 0.7;
	font-size: 0.85rem;
}

.org-switcher-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 0.35rem);
	min-width: 260px;
	max-width: 340px;
	max-height: 320px;
	overflow: auto;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 0.75rem;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
	padding: 0.35rem;
	z-index: 10000;
	display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.org-switcher-item {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	text-align: left;
	border: none;
	background: transparent;
	padding: 0.55rem 0.6rem;
	border-radius: 0.55rem;
	cursor: pointer;
	font-weight: 700;
	color: #1f2937;
}

.org-switcher-item i {
	width: 1.1rem;
	text-align: center;
	color: #374151;
	flex: 0 0 auto;
}

.org-switcher-item span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.org-switcher-item:hover {
	background: rgba(1, 104, 173, 0.10);
}

.org-switcher-item.active {
	background: rgba(1, 104, 173, 0.18);
}

/* Tooltips */
.custom-tooltip {
	position: absolute;
	background-color: #2c3e50;
	color: white;
	padding: 0.5rem 0.75rem;
	border-radius: 0.25rem;
	font-size: 0.875rem;
	pointer-events: none;
	z-index: 10000;
	opacity: 0;
	transform: translateY(-5px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	max-width: 250px;
	word-wrap: break-word;
	white-space: normal;
}

.custom-tooltip.show {
	opacity: 1;
	transform: translateY(0);
}

.custom-tooltip[data-position="top"] {
	transform: translateY(5px);
}

.custom-tooltip[data-position="top"].show {
	transform: translateY(0);
}

.custom-tooltip[data-position="left"] {
	transform: translateX(5px);
}

.custom-tooltip[data-position="left"].show {
	transform: translateX(0);
}

.custom-tooltip[data-position="right"] {
	transform: translateX(-5px);
}

.custom-tooltip[data-position="right"].show {
	transform: translateX(0);
}

/* Flèche du tooltip */
.custom-tooltip::before {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border-style: solid;
}

.custom-tooltip[data-position="bottom"]::before {
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border-width: 0 6px 6px 6px;
	border-color: transparent transparent #2c3e50 transparent;
}

.custom-tooltip[data-position="top"]::before {
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border-width: 6px 6px 0 6px;
	border-color: #2c3e50 transparent transparent transparent;
}

.custom-tooltip[data-position="left"]::before {
	left: 100%;
	top: 50%;
	transform: translateY(-50%);
	border-width: 6px 0 6px 6px;
	border-color: transparent transparent transparent #2c3e50;
}

.custom-tooltip[data-position="right"]::before {
	right: 100%;
	top: 50%;
	transform: translateY(-50%);
	border-width: 6px 6px 6px 0;
	border-color: transparent #2c3e50 transparent transparent;
}

.header-content-title {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    align-items: center;
    margin-bottom: 1rem;	
}


.toggle-pw {
	position: absolute;
	right: 0;
	display: inline;
	background: none;
	border: none;
	cursor: pointer;
	color: #888;
	font-size: 1rem;
	width: auto;
}

.toggle-pw:focus {
	box-shadow: none;
}

.org_name {
	font-weight: 500;
    color: #1971b9;
}

h1.screen-title {
	margin-bottom: 0;
    text-transform: uppercase;
	font-size: clamp(1rem, calc(3vw + 0.25rem), 2rem);
	text-align: center;
}

p.username {
	font-weight: 500;
    color: #1971b9;
	text-transform: uppercase;
	font-size: 1.5rem;
}

#username {
	background: #f3f4f6;
}

#code-inputs .code-box {
	width: 3.5rem;
	height: 3.5rem;
	font-size: 2rem;
	padding: 0;
	margin-bottom: 0;
	text-align: center;
	border-radius: 0.5rem;
	border: 1px solid #d1d5db;
	transition: border-color 0.2s;
}

#code-inputs .code-box:focus {
	border-color: #6366f1;
	outline: none;
	background: #fff;
}

#lang-switch {
	position: relative;
    grid-column: 2;
    top: -1.5rem;
    text-align: right;
    height: 0;
}

@media (max-width: 600px) {
	#lang-switch {
		grid-column: 1;
	}
}


#lang-switch img {
	opacity: 0.4;
	transition: opacity 0.2s, box-shadow 0.2s;
	padding: 0;
	background-color: unset;
	border: none;
	cursor: pointer;
	width: 36px;
	height: 27px;
	/*outline: none;
	box-shadow: none;*/
}

#lang-switch img.active-lang {
	opacity: 1;
}

.main-container {
	padding-left: 2rem;
	padding-right: 2rem;
	flex: 1 1 0;
	min-height: 0;
	overflow-y: auto;
	scrollbar-width: thin;
}

button {
	/* a nice blue button */
	background-color: #3498db;
	color: white;
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 0.25rem;
	font-size: 1rem;
	cursor: pointer;
}

.cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	grid-template-rows: repeat(auto-fit, auto 1fr);
	/* 2 lignes : header fixe + body flexible */
	gap: 1rem;
	margin-top: 2rem;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

.card {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 2;
	/* Chaque carte occupe 2 lignes du grid parent */
	border: 1px solid #ddd;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
	transition: transform .15s ease;
	background: #fff;
	min-width: 0;
	/* Permet au contenu de se rétrécir */
}

.card:hover {
	transform: translateY(-2px);
}

.card-header {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .6rem 1rem;
	color: #fff;
}

.card-header i {
	opacity: .95;
}

.card-header-icon {
	font-size: 2rem;
	background-color: rgba(255, 255, 255, 0.15);
	padding: 0.5rem;
	border-radius: 0.25rem;
	min-width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.card-title {
	font-weight: 700;
}

.card-body {
	padding: 0 1rem 1rem 1rem;
}

h1.title {
	color: #3498db;
	font-variant: small-caps;
}

a.card.disabled {
	pointer-events: none;
	color: gray;
	text-decoration: none;
	cursor: default;
	background: gainsboro;
}

a.card.disabled .card-header {
	opacity: 0.75;
}

.card-body small {
	/* alignement du bloc à droite */
	display: block;
	text-align: right;
	font-style: italic;
	text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

footer {
	text-align: center;
	padding: 1rem;
	margin-top: 2rem;
}

h1.title .portAIl {
	color: red;
}