/* =========================================================
   Espace client Aston Business Solutions
   ========================================================= */
:root {
	--aec-primary: #0f2744;
	--aec-accent: #f59e0b;
	--aec-bg: #f5f7fa;
	--aec-border: #e3e8ef;
	--aec-text: #1c2b3a;
	--aec-muted: #64748b;
	--aec-radius: 12px;
}

.aec-wrap { max-width: 1140px; margin: 0 auto; padding: 8px 16px 48px; color: var(--aec-text); font-size: 16px; line-height: 1.55; }
.aec-wrap *, .aec-wrap *::before, .aec-wrap *::after { box-sizing: border-box; }

/* ---------- Notices ---------- */
.aec-notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 20px; font-weight: 500; }
.aec-notice--ok   { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.aec-notice--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.aec-notice--err  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- Boutons ---------- */
.aec-btn { display: inline-block; padding: 10px 20px; border-radius: 8px; border: 1px solid var(--aec-primary); background: #fff; color: var(--aec-primary); font-weight: 600; cursor: pointer; text-decoration: none; transition: all .15s ease; font-size: 15px; line-height: 1.3; }
.aec-btn:hover { background: var(--aec-primary); color: #fff; }
.aec-btn--primary { background: var(--aec-accent); border-color: var(--aec-accent); color: #fff; }
.aec-btn--primary:hover { filter: brightness(.92); background: var(--aec-accent); color: #fff; }
.aec-btn--sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Auth ---------- */
.aec-auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; margin-top: 12px; }
.aec-auth__intro h2 { font-size: 28px; margin: 0 0 12px; color: var(--aec-primary); }
.aec-auth__intro h2 span { color: var(--aec-accent); display: block; font-size: 20px; }
.aec-auth__logo { max-height: 56px; margin-bottom: 16px; }
.aec-auth__list { list-style: none; padding: 0; margin: 16px 0 0; }
.aec-auth__list li { padding: 7px 0 7px 30px; position: relative; }
.aec-auth__list li::before { content: "✓"; position: absolute; left: 0; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--aec-accent); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.aec-auth__forms { background: #fff; border: 1px solid var(--aec-border); border-radius: var(--aec-radius); padding: 24px; box-shadow: 0 10px 30px rgba(15, 39, 68, .08); }

.aec-tabs { display: flex; gap: 8px; margin-bottom: 20px; background: var(--aec-bg); padding: 4px; border-radius: 10px; }
.aec-tabs__btn { flex: 1; padding: 10px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; cursor: pointer; color: var(--aec-muted); }
.aec-tabs__btn.is-active { background: var(--aec-primary); color: #fff; }

/* ---------- Formulaires ---------- */
.aec-form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; color: var(--aec-primary); }
.aec-form input[type="text"], .aec-form input[type="email"], .aec-form input[type="password"],
.aec-form input[type="tel"], .aec-form input[type="url"], .aec-form input[type="file"],
.aec-form select, .aec-form textarea {
	display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--aec-border);
	border-radius: 8px; font-size: 15px; font-weight: 400; background: #fff; color: var(--aec-text);
}
.aec-form input:focus, .aec-form select:focus, .aec-form textarea:focus { outline: 2px solid var(--aec-accent); outline-offset: 0; border-color: var(--aec-accent); }
.aec-check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.aec-check input { width: auto !important; display: inline-block !important; margin: 0 !important; }
.aec-form__foot { font-size: 13px; color: var(--aec-muted); margin-top: 12px; }
.aec-hp { position: absolute !important; left: -9999px !important; }
.aec-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

.aec-choice { border: 0; padding: 0; margin: 0 0 18px; }
.aec-choice legend { font-weight: 700; color: var(--aec-primary); margin-bottom: 10px; }
.aec-choice__item { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--aec-border); border-radius: 10px; padding: 12px 16px; margin: 0 10px 10px 0; cursor: pointer; font-weight: 600; }
.aec-choice__item:has(input:checked) { border-color: var(--aec-accent); background: #fffbeb; }
.aec-choice__item input { accent-color: var(--aec-accent); }

/* ---------- Portail ---------- */
.aec-portal { display: grid; grid-template-columns: 260px 1fr; gap: 28px; margin-top: 12px; }
.aec-side { background: var(--aec-primary); border-radius: var(--aec-radius); padding: 20px 14px; color: #fff; position: sticky; top: 20px; align-self: start; }
.aec-side__id { display: flex; gap: 12px; align-items: center; padding: 4px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 12px; }
.aec-side__id strong { display: block; font-size: 15px; }
.aec-side__id span { font-size: 12px; opacity: .7; word-break: break-all; }
.aec-side__logo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; padding: 3px; }
.aec-side__initial { width: 44px; height: 44px; border-radius: 10px; background: var(--aec-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex: none; }
.aec-side__nav a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.85); text-decoration: none; padding: 10px 10px; border-radius: 8px; font-weight: 500; font-size: 15px; }
.aec-side__nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.aec-side__nav a.is-active { background: var(--aec-accent); color: #fff; font-weight: 700; }
.aec-side__ico { width: 20px; text-align: center; }
.aec-side__ext { border-top: 1px solid rgba(255,255,255,.15); margin-top: 8px; padding-top: 12px !important; }
.aec-side__logout { display: block; margin-top: 16px; text-align: center; color: rgba(255,255,255,.6); font-size: 13px; text-decoration: underline; }
.aec-side__logout:hover { color: #fff; }

.aec-main { min-width: 0; }
.aec-h2 { font-size: 26px; color: var(--aec-primary); margin: 0 0 8px; }
.aec-h3 { font-size: 18px; color: var(--aec-primary); margin: 28px 0 10px; }
.aec-intro { color: var(--aec-muted); margin: 0 0 22px; }
.aec-empty { background: #fff; border: 1px dashed var(--aec-border); border-radius: var(--aec-radius); padding: 28px; text-align: center; color: var(--aec-muted); }

.aec-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.aec-card { background: #fff; border: 1px solid var(--aec-border); border-radius: var(--aec-radius); padding: 18px; text-decoration: none; color: var(--aec-text); transition: box-shadow .15s ease; }
.aec-card:hover { box-shadow: 0 8px 22px rgba(15,39,68,.1); }
.aec-card__num { display: block; font-size: 32px; font-weight: 800; color: var(--aec-accent); line-height: 1.1; }
.aec-card__lbl { font-size: 14px; color: var(--aec-muted); font-weight: 600; }
.aec-card__lbl small { display: block; font-weight: 400; }
.aec-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }

/* ---------- Tables ---------- */
.aec-tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--aec-border); border-radius: var(--aec-radius); }
.aec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.aec-table th { text-align: left; padding: 12px 14px; background: var(--aec-bg); color: var(--aec-primary); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.aec-table td { padding: 12px 14px; border-top: 1px solid var(--aec-border); vertical-align: top; }
.aec-table__note td { background: #fffbeb; font-size: 13px; }
.aec-badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.aec-badge--en_attente { background: #f1f5f9; color: #475569; }
.aec-badge--validee    { background: #eff6ff; color: #1d4ed8; }
.aec-badge--en_cours   { background: #fffbeb; color: #b45309; }
.aec-badge--livree     { background: #ecfdf5; color: #047857; }
.aec-badge--annulee    { background: #fef2f2; color: #b91c1c; }

/* ---------- Profil ---------- */
.aec-logobox { display: flex; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--aec-border); border-radius: var(--aec-radius); padding: 16px; margin-bottom: 20px; }
.aec-logobox__img { width: 90px; height: 90px; object-fit: contain; border-radius: 10px; border: 1px solid var(--aec-border); background: #fff; }
.aec-logobox__ph { width: 90px; height: 90px; border-radius: 10px; border: 2px dashed var(--aec-border); display: flex; align-items: center; justify-content: center; color: var(--aec-muted); flex: none; }
.aec-logobox__input { flex: 1; margin: 0 !important; }

/* ---------- Chatbot ---------- */
.aec-chat__toggle { position: fixed; right: 22px; bottom: 22px; z-index: 99998; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--aec-accent); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 10px 26px rgba(15,39,68,.3); transition: transform .15s ease; }
.aec-chat__toggle:hover { transform: scale(1.07); }
.aec-chat { position: fixed; right: 22px; bottom: 94px; z-index: 99999; width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 130px); background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(15,39,68,.3); display: flex; flex-direction: column; overflow: hidden; font-size: 14px; color: var(--aec-text); }
.aec-chat__head { background: var(--aec-primary); color: #fff; padding: 14px 16px; position: relative; }
.aec-chat__head strong { display: block; font-size: 16px; }
.aec-chat__head span { font-size: 12px; opacity: .75; }
.aec-chat__close { position: absolute; right: 10px; top: 10px; background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.aec-chat__body { flex: 1; overflow-y: auto; padding: 14px; background: var(--aec-bg); }
.aec-chat__msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; margin-bottom: 10px; white-space: pre-wrap; }
.aec-chat__msg--bot { background: #fff; border: 1px solid var(--aec-border); border-bottom-left-radius: 4px; }
.aec-chat__msg--user { background: var(--aec-primary); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.aec-chat__msg a { color: var(--aec-accent); font-weight: 600; }
.aec-chat__quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.aec-chat__quick button { border: 1px solid var(--aec-primary); color: var(--aec-primary); background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-weight: 600; }
.aec-chat__quick button:hover { background: var(--aec-primary); color: #fff; }
.aec-chat__input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--aec-border); background: #fff; }
.aec-chat__input input { flex: 1; border: 1px solid var(--aec-border); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.aec-chat__input input:focus { outline: 2px solid var(--aec-accent); border-color: var(--aec-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
	.aec-auth { grid-template-columns: 1fr; }
	.aec-portal { grid-template-columns: 1fr; }
	.aec-side { position: static; }
	.aec-side__nav { display: flex; flex-wrap: wrap; gap: 4px; }
	.aec-side__nav a { padding: 8px 10px; font-size: 14px; }
	.aec-side__ext { border-top: 0; margin-top: 0; padding-top: 8px !important; }
	.aec-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.aec-table thead { display: none; }
	.aec-table tr { display: block; border-top: 1px solid var(--aec-border); padding: 8px 0; }
	.aec-table td { display: flex; gap: 10px; border: 0; padding: 4px 14px; }
	.aec-table td::before { content: attr(data-l); font-weight: 700; color: var(--aec-primary); min-width: 92px; }
}
