:root {
  --bg-primary: #0b1120;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --border-color: #334155;
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-blue: #2563eb;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Login styling */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0b1120 70%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo-mark {
  display: inline-flex;
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-red);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dashboard Layout */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: #0f172a;
  border-bottom: 1px solid var(--border-color);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-tag {
  font-size: 14px;
  color: var(--text-muted);
}

.btn-secondary {
  padding: 8px 16px;
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #334155;
}

/* Bouton Redémarrer moderne & harmonieux */
.btn-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  height: 38px;
  white-space: nowrap;
}

.btn-restart:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}

.btn-restart:active {
  transform: translateY(0);
}

.btn-restart svg {
  transition: transform 0.4s ease;
  flex-shrink: 0;
}

.btn-restart:hover svg {
  transform: rotate(-180deg);
}

.btn-primary.btn-gold {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  border: none;
  color: #0f172a;
  font-weight: 700;
}

.btn-primary.btn-android {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  color: #0f172a;
  font-weight: 700;
}

.btn-primary.btn-android:hover:not(:disabled) {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}

.btn-primary.btn-steam {
  background: linear-gradient(135deg, #1b2838 0%, #171a21 50%, #2a475e 100%);
  border: 1px solid rgba(102, 192, 244, 0.4);
  color: #c7d5e0;
  font-weight: 700;
}

.btn-primary.btn-steam:hover:not(:disabled) {
  background: linear-gradient(135deg, #2a475e 0%, #1b2838 50%, #66c0f4 100%);
  color: #fff;
  border-color: #66c0f4;
  box-shadow: 0 4px 14px rgba(102, 192, 244, 0.4);
}


.dashboard-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.app-main {
  flex: 1;
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Annonce bas de page - 100% largeur écran, hauteur 300px */
.portal-bottom-ad {
  width: 100%;
  min-height: 300px;
  height: 300px;
  background: #0f172a;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: auto;
  box-sizing: border-box;
}

#ami-placement-26 {
  width: 100%;
  min-height: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-card:hover {
  border-color: #475569;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-info h3 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.card-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-blue {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-gray {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Session Viewer Viewport - 100% Fullscreen */
#session-view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 1000;
  overflow: hidden;
}

.session-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

#guac-display {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* Floating Left Drawer */
.session-drawer {
  position: absolute;
  top: 70px;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.session-drawer.closed {
  transform: translateX(-300px);
}

.session-drawer.open {
  transform: translateX(0);
}

.drawer-sheet {
  width: 300px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: none;
  border-radius: 0 16px 16px 0;
  box-shadow: 10px 20px 40px rgba(0, 0, 0, 0.75);
  padding: 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-handle {
  width: 34px;
  height: 64px;
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-left: none;
  border-radius: 0 12px 12px 0;
  color: #38bdf8;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 4px 6px 20px rgba(0, 0, 0, 0.5);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, width 0.2s ease;
  user-select: none;
  touch-action: none;
}

.drawer-handle:hover {
  background: rgba(15, 23, 42, 0.98);
  border-color: #38bdf8;
  width: 38px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.drawer-handle:active,
.drawer-handle.dragging {
  cursor: grabbing;
  background: rgba(15, 23, 42, 1);
  border-color: #38bdf8;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
  transform: scale(1.05);
}

.handle-grip-lines {
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  align-items: center;
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.handle-grip-lines span {
  display: block;
  width: 10px;
  height: 2px;
  background-color: #38bdf8;
  border-radius: 1px;
}

.drawer-handle:hover .handle-grip-lines,
.drawer-handle.dragging .handle-grip-lines {
  opacity: 1;
}

.session-drawer.open .drawer-handle .handle-icon {
  transform: rotate(180deg);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.drawer-title-box h3 {
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 6px;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}

.drawer-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.drawer-action-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(56, 189, 248, 0.3);
  color: #fff;
  transform: translateX(2px);
}

.drawer-action-btn.btn-danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.drawer-action-btn.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

/* Drawer Select for Keyboard Layout */
.drawer-select-wrapper {
  position: relative;
  width: 100%;
}

.drawer-select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.drawer-select:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.15);
}

.drawer-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.drawer-select option {
  background: #0f172a;
  color: #fff;
  padding: 8px;
}

.drawer-select-wrapper .select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.drawer-toast {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #22c55e;
  font-weight: 600;
  padding: 5px 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 6px;
  width: fit-content;
  animation: fadeIn 0.2s ease;
}

/* Card Progress Bars */
.card-progress-box {
  margin-top: 14px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-animated {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #38bdf8);
  background-size: 200% 100%;
  border-radius: 9999px;
  animation: progressPulse 1.8s linear infinite;
  transition: width 0.4s ease;
  width: 30%;
}

.progress-bar-animated.progress-bar-green {
  background: linear-gradient(90deg, #22c55e, #86efac, #22c55e);
  background-size: 200% 100%;
}

.progress-bar-animated.progress-bar-steam {
  background: linear-gradient(90deg, #1b2838, #66c0f4, #2a475e, #66c0f4);
  background-size: 200% 100%;
}

@keyframes progressPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-label {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Fullscreen Session Loading Overlay */
.session-loading-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity 0.4s ease;
}

.loading-box {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 36px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loading-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  margin-bottom: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-box h2 {
  font-size: 20px;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
}

.loading-box p {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.loading-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #38bdf8);
  background-size: 200% 100%;
  border-radius: 9999px;
  animation: progressPulse 1.8s linear infinite;
  width: 45%;
  transition: width 0.3s ease;
}

.loading-status-msg {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 500;
}

/* Toast d'avertissement d'inactivité */
.inactivity-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.2);
  border-radius: 9999px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f8fafc;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.inactivity-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.inactivity-toast-icon {
  width: 20px;
  height: 20px;
  color: #f59e0b;
  flex-shrink: 0;
  animation: pulseWarning 1.5s ease-in-out infinite;
}

@keyframes pulseWarning {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.inactivity-toast strong {
  color: #f59e0b;
}

/* Zone Presse-papier du volet latéral */
.drawer-clipboard-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11.5px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 58px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.drawer-clipboard-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* HUD Visuel de Volume pour les touches volume */
.volume-hud-toast {
  position: fixed;
  top: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 240px;
  color: #f8fafc;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.volume-hud-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.volume-hud-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.volume-hud-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.volume-hud-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.volume-hud-label {
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.volume-hud-percent {
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}

.volume-hud-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(51, 65, 85, 0.8);
  border-radius: 9999px;
  overflow: hidden;
}

.volume-hud-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 9999px;
  transition: width 0.12s ease-out;
}

.card-progress-box.is-warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.card-progress-box.is-warning .progress-label {
  color: #fcd34d;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar-animated,
  .loading-progress-bar,
  .loading-spinner,
  .inactivity-toast-icon {
    animation: none;
  }
}




