/* ==========================================================================
   Apex Partners : espace partenaire
   Identité du site : graphite, orange Apex, Orbitron + Rajdhani, coins coupés.
   Élément signature : le code promo présenté comme un ticket à encoches.
   ========================================================================== */

:root {
	--bg: #0d0d0f;
	--panel: #17171a;
	--panel-2: #1f1f24;
	--line: #2a2a31;
	--orange: #ff4d1c;
	--orange-soft: rgba(255, 77, 28, 0.12);
	--gold: #ffb347;
	--text: #f5f5f5;
	--muted: #a3a3ad;
	--ok: #4ade80;
	--err: #ff8a8a;
	--cut: 14px;
	--display: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
	--body: 'Rajdhani', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html {
	background: var(--bg);
}

body.apxp-body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background:
		radial-gradient(900px 500px at 85% -10%, rgba(255, 77, 28, 0.14), transparent 60%),
		var(--bg);
	color: var(--text);
	font-family: var(--body);
	font-size: 18px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--text);
}

:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   En-tête et pied de page
   -------------------------------------------------------------------------- */

.apxp-top {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px clamp(16px, 4vw, 40px);
	border-bottom: 1px solid var(--line);
	background: rgba(13, 13, 15, 0.85);
	backdrop-filter: blur(6px);
	position: sticky;
	top: 0;
	z-index: 10;
}

.apxp-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	font-family: var(--display);
	font-weight: 900;
	font-size: 15px;
	letter-spacing: 0.04em;
}

.apxp-brand img {
	width: 44px;
	height: auto;
}

.apxp-top__label {
	color: var(--muted);
	font-weight: 600;
	padding-left: 16px;
	border-left: 1px solid var(--line);
}

.apxp-top__out {
	margin-left: auto;
	color: var(--muted);
	font-weight: 600;
	text-decoration: none;
}

.apxp-top__out:hover {
	color: var(--orange);
}

.apxp-main {
	flex: 1;
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px);
	display: grid;
	gap: 22px;
	align-content: start;
}

.apxp-foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 20px;
	padding: 20px clamp(16px, 4vw, 40px);
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 15px;
}

.apxp-foot a {
	color: var(--muted);
}

/* --------------------------------------------------------------------------
   Éléments communs
   -------------------------------------------------------------------------- */

.apxp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 12px 26px;
	background: var(--orange);
	color: #fff;
	border: 0;
	font-family: var(--display);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-decoration: none;
	cursor: pointer;
	clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
	transition: background-color 0.15s ease;
}

.apxp-btn:hover {
	background: #ff6a40;
}

.apxp-btn--small {
	min-height: 40px;
	padding: 8px 16px;
	font-size: 12px;
}

.apxp-btn--ghost {
	background: var(--panel-2);
	box-shadow: inset 0 0 0 1px var(--line);
}

.apxp-btn--ghost:hover {
	background: #26262c;
}

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

.apxp-field {
	display: grid;
	gap: 6px;
}

.apxp-field label {
	font-weight: 600;
	font-size: 16px;
}

.apxp-field input,
.apxp-inline input {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	background: var(--bg);
	color: var(--text);
	border: 1px solid #34343c;
	border-radius: 0;
	font: inherit;
}

.apxp-field input:focus,
.apxp-inline input:focus {
	outline: none;
	border-color: var(--orange);
	box-shadow: 0 0 0 1px var(--orange);
}

.apxp-check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	cursor: pointer;
}

.apxp-check input {
	width: 18px;
	height: 18px;
	accent-color: var(--orange);
}

.apxp-alert {
	margin: 0;
	padding: 12px 16px;
	font-weight: 600;
	border-left: 3px solid;
}

.apxp-alert--ok {
	background: rgba(74, 222, 128, 0.08);
	border-color: var(--ok);
	color: #b7f5cb;
}

.apxp-alert--error {
	background: rgba(255, 138, 138, 0.08);
	border-color: var(--err);
	color: var(--err);
}

.apxp-adminbar {
	margin: 0;
	padding: 10px 14px;
	background: var(--orange-soft);
	color: var(--gold);
	font-weight: 600;
	font-size: 16px;
}

.apxp-adminbar a {
	color: var(--gold);
	margin-left: 8px;
}

.apxp-muted {
	margin: 0;
	color: var(--muted);
	font-size: 15px;
}

.apxp-note {
	margin: 0;
	color: var(--muted);
}

.apxp-note strong {
	color: var(--text);
}

.apxp-h2 {
	margin: 0;
	font-family: var(--display);
	font-weight: 700;
	font-size: 19px;
}

.apxp-panel {
	display: grid;
	gap: 16px;
	padding: clamp(18px, 3vw, 28px);
	background: var(--panel);
	clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

/* --------------------------------------------------------------------------
   Connexion
   -------------------------------------------------------------------------- */

.apxp-login {
	display: grid;
	justify-items: center;
	gap: 18px;
	padding-top: clamp(8px, 6vh, 64px);
}

.apxp-login__card {
	width: min(440px, 100%);
	display: grid;
	gap: 16px;
	padding: clamp(24px, 5vw, 36px);
	background: linear-gradient(180deg, #1b1b1f 0%, #141417 100%);
	box-shadow: inset 0 3px 0 var(--orange);
	clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.apxp-login__title {
	margin: 0;
	font-family: var(--display);
	font-weight: 900;
	font-size: clamp(26px, 5vw, 32px);
	line-height: 1.1;
}

.apxp-login__lead {
	margin: 0;
	color: var(--muted);
}

.apxp-login__card .apxp-btn {
	width: 100%;
}

.apxp-login__lost {
	justify-self: center;
	color: var(--muted);
	font-weight: 600;
	font-size: 16px;
}

.apxp-login__lost:hover {
	color: var(--orange);
}

.apxp-login__aside {
	margin: 0;
	color: var(--muted);
	font-size: 15px;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Tableau de bord
   -------------------------------------------------------------------------- */

.apxp-hello {
	display: grid;
	gap: 18px;
}

.apxp-hello__title {
	margin: 0;
	font-family: var(--display);
	font-weight: 900;
	font-size: clamp(26px, 4.4vw, 42px);
	line-height: 1.1;
}

.apxp-code {
	display: grid;
	gap: 16px;
	align-items: stretch;
}

@media (min-width: 820px) {
	.apxp-code {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	}
}

/* Ticket à encoches : le code promo. */
.apxp-code__ticket {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 4px 16px;
	padding: 20px 30px;
	background: var(--orange);
	color: #fff;
	-webkit-mask: radial-gradient(circle 13px at 0 50%, transparent 12px, #000 13px) left / 51% 100% no-repeat,
		radial-gradient(circle 13px at 100% 50%, transparent 12px, #000 13px) right / 51% 100% no-repeat;
	mask: radial-gradient(circle 13px at 0 50%, transparent 12px, #000 13px) left / 51% 100% no-repeat,
		radial-gradient(circle 13px at 100% 50%, transparent 12px, #000 13px) right / 51% 100% no-repeat;
}

.apxp-code__label {
	grid-column: 1;
	font-weight: 700;
	font-size: 15px;
	opacity: 0.9;
}

.apxp-code__value {
	grid-column: 1;
	font-family: var(--display);
	font-weight: 900;
	font-size: clamp(26px, 4.5vw, 38px);
	line-height: 1.1;
	letter-spacing: 0.04em;
	overflow-wrap: anywhere;
}

.apxp-code__deal {
	grid-column: 1;
	font-weight: 700;
	font-size: 16px;
}

.apxp-code__ticket .apxp-copy {
	grid-column: 2;
	grid-row: 1 / span 3;
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	border: 1px dashed rgba(255, 255, 255, 0.55);
}

.apxp-code__ticket .apxp-copy:hover {
	background: rgba(0, 0, 0, 0.4);
}

.apxp-code__link {
	display: grid;
	gap: 8px;
	align-content: center;
	padding: 18px 20px;
	background: var(--panel);
}

.apxp-code__link label {
	font-weight: 600;
	font-size: 16px;
	color: var(--muted);
}

.apxp-inline {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}

.apxp-inline input {
	min-height: 44px;
	font-size: 16px;
}

.apxp-copy {
	min-height: 44px;
	padding: 8px 16px;
	background: var(--panel-2);
	color: var(--text);
	border: 1px solid #34343c;
	font: inherit;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}

.apxp-copy:hover {
	border-color: var(--orange);
}

.apxp-stats {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
	.apxp-stats {
		grid-template-columns: 1.3fr 1fr 1fr 1fr;
	}
}

.apxp-stat {
	display: grid;
	gap: 6px;
	align-content: start;
	padding: 18px;
	background: var(--panel);
	clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.apxp-stat--main {
	grid-column: 1 / -1;
	background:
		radial-gradient(120% 120% at 100% 0%, rgba(255, 77, 28, 0.22) 0%, rgba(255, 77, 28, 0) 60%),
		var(--panel);
	box-shadow: inset 0 3px 0 var(--orange);
}

@media (min-width: 900px) {
	.apxp-stat--main {
		grid-column: auto;
	}
}

.apxp-stat__label {
	color: var(--muted);
	font-weight: 600;
	font-size: 16px;
}

.apxp-stat__value {
	font-family: var(--display);
	font-weight: 700;
	font-size: clamp(22px, 3vw, 28px);
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.apxp-stat--main .apxp-stat__value {
	font-weight: 900;
	font-size: clamp(32px, 5vw, 42px);
	color: var(--text);
}

.apxp-stat--main .apxp-btn {
	justify-self: start;
	margin-top: 6px;
}

.apxp-stat__value--muted {
	color: var(--muted);
}

.apxp-stat__hint {
	color: var(--muted);
	font-size: 15px;
}

/* Retrait */

.apxp-withdraw {
	display: grid;
	gap: 14px;
	max-width: 420px;
}

.apxp-amount {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	border: 1px solid #34343c;
	background: var(--bg);
}

.apxp-amount:focus-within {
	border-color: var(--orange);
	box-shadow: 0 0 0 1px var(--orange);
}

.apxp-amount input {
	border: 0;
	font-family: var(--display);
	font-weight: 700;
	font-size: 22px;
}

.apxp-amount input:focus {
	box-shadow: none;
}

.apxp-amount span {
	padding: 0 14px;
	font-family: var(--display);
	font-weight: 700;
	color: var(--muted);
}

.apxp-link-btn {
	justify-self: start;
	padding: 0;
	background: none;
	border: 0;
	color: var(--gold);
	font: inherit;
	font-weight: 600;
	font-size: 15px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.apxp-iban {
	border-top: 1px solid var(--line);
	padding-top: 14px;
}

.apxp-iban summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--muted);
}

.apxp-iban[open] summary {
	margin-bottom: 14px;
	color: var(--text);
}

.apxp-iban .apxp-form {
	max-width: 520px;
}

/* Listes (historique, retraits) */

.apxp-rows {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--line);
}

.apxp-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 2px 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}

.apxp-row__main {
	font-weight: 700;
}

.apxp-row__sub {
	grid-column: 1;
	color: var(--muted);
	font-size: 15px;
}

.apxp-row__amount,
.apxp-row .apxp-chip {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: center;
	text-align: right;
}

.apxp-row__amount {
	font-family: var(--display);
	font-weight: 700;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.apxp-row__amount small {
	display: block;
	font-family: var(--body);
	font-weight: 600;
	font-size: 13px;
	color: var(--gold);
}

.apxp-row__amount.is-pos {
	color: var(--text);
}

.apxp-row__amount.is-neg {
	color: var(--muted);
}

.apxp-chip {
	display: inline-block;
	padding: 4px 10px;
	font-size: 14px;
	font-weight: 700;
	background: var(--panel-2);
	color: var(--muted);
}

.apxp-chip--requested {
	background: rgba(255, 179, 71, 0.12);
	color: var(--gold);
}

.apxp-chip--paid {
	background: rgba(74, 222, 128, 0.1);
	color: var(--ok);
}

.apxp-chip--rejected {
	background: rgba(255, 138, 138, 0.1);
	color: var(--err);
}

@media (max-width: 560px) {
	body.apxp-body {
		font-size: 17px;
	}
	.apxp-top__label {
		display: none;
	}
	.apxp-code__ticket {
		padding: 18px 24px;
	}
	.apxp-stats {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apxp-btn {
		transition: none;
	}
}
