/* Portail Le Chai à Canons - styles communs */

:root {
  --bg: #f5f2ea;
  --card: #ffffff;
  --text: #1f1d1a;
  --muted: #6b6660;
  --accent: #7a1f1f;
  --accent-hover: #5a1717;
  --border: #e3dfd5;
  --btn-bg: #444;
  --btn-bg-hover: #2a2a2a;
  --btn-text: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

header.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

header.portal-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

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

header.portal-header .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

/* Grille d'applications */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  color: inherit;
  text-decoration: none;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

.app-card.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.app-card .app-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}

.app-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

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

.app-card .badge {
  display: inline-block;
  font-size: 11px;
  background: var(--border);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  width: fit-content;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover { background: var(--btn-bg-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card); color: var(--text); }

/* Login */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 4px 0;
  font-size: 20px;
  text-align: center;
}

.login-card .subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-card label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card .error {
  color: var(--accent);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

footer.portal-footer {
  margin-top: 48px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
