/* Kamoul site. Colors and shapes follow the old MudBlazor site. */

:root {
  --red: #e51627;
  --red-dark: #c0121f;
  --drawer: #ce1423;
  --red-gradient: linear-gradient(135deg, #e51627 0%, #c0121f 100%);
  --text: rgba(0, 0, 0, 0.87);
  --text-muted: #666;
  --text-secondary: rgba(0, 0, 0, 0.6);
  --line: rgba(0, 0, 0, 0.12);
  --field-line: rgba(0, 0, 0, 0.23);
  --success: #4caf50;
  --info: #2196f3;
  --warning: #ff9800;
  --error: #f44336;
  --radius: 4px;
  --bar-height: 64px;
  --elevation-1: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
  --elevation-2: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
  --elevation-4: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12);
  --elevation-8: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
  --elevation-12: 0 7px 8px -4px rgba(0,0,0,.2), 0 12px 17px 2px rgba(0,0,0,.14), 0 5px 22px 4px rgba(0,0,0,.12);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
}

img { max-width: 100%; }

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}
.icon-48 { width: 48px; height: 48px; }
.success { color: var(--success); }
.danger { color: var(--error); }

/* ----- App bar ----- */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--bar-height);
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  box-shadow: var(--elevation-1);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  list-style: none;
}
.icon-button:hover { background: rgba(255, 255, 255, 0.12); }

summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary:focus-visible, .icon-button:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.brand { display: inline-flex; }
.brand img { display: block; height: 40px; width: auto; }

.page-name {
  margin-left: 8px;
  font-size: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spacer { flex: 1; }

/* Menu drawer: a <details> element, so it opens without JavaScript. */
.nav-menu .icon-open, .nav-menu[open] .icon-closed { display: none; }
.nav-menu[open] .icon-open { display: block; }

.drawer {
  position: fixed;
  top: var(--bar-height);
  left: 0;
  bottom: 0;
  z-index: 1300;
  width: 240px;
  padding: 12px 0;
  overflow-y: auto;
  background: var(--drawer);
  box-shadow: var(--elevation-2);
}
.drawer a {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 12px;
  color: #fff;
  text-decoration: none;
}
.drawer a:hover { background: rgba(255, 255, 255, 0.08); }
.drawer a.active {
  border-left: 4px solid #fff;
  padding-left: 8px;
}
.drawer img { display: block; height: 40px; width: auto; }
.drawer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Account menu */
.user-menu { position: relative; }
.user-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
}
.user-button:hover { background: rgba(255, 255, 255, 0.12); }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.avatar .icon { width: 20px; height: 20px; }
.user-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px 0;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  box-shadow: var(--elevation-8);
}
.menu-label {
  padding: 4px 16px 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: rgba(0, 0, 0, 0.04); }

@media (max-width: 599px) {
  .app-bar { padding: 0 8px; gap: 4px; }
  .user-name { display: none; }
  .user-button { padding: 4px; }
}

/* ----- Page ----- */

.page {
  min-height: calc(100vh - var(--bar-height));
  background-color: #fff;
  background-image: url("/static/background-pattern.svg");
  background-size: 40px 40px;
  background-repeat: repeat;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 16px;
}
.container-small { max-width: 600px; }

.card {
  display: block;
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.elevation-2 { box-shadow: var(--elevation-2); }
.elevation-4 { box-shadow: var(--elevation-4); }
.elevation-8 { box-shadow: var(--elevation-8); }

.stack { display: grid; gap: 16px; }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.link { color: var(--red); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ----- Buttons ----- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02857em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.button-large { min-height: 42px; padding: 8px 22px; font-size: 0.9375rem; }
.button-block { display: flex; width: 100%; }
.button-primary { background: var(--red); color: #fff; box-shadow: var(--elevation-2); }
.button-primary:hover { background: var(--red-dark); box-shadow: var(--elevation-4); }
.button-outlined { border-color: var(--red); color: var(--red); }
.button-outlined:hover { background: rgba(229, 22, 39, 0.04); }
.button-text:hover { background: rgba(0, 0, 0, 0.04); }
.button[aria-busy="true"] { opacity: 0.7; cursor: progress; }

/* ----- Forms ----- */

.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.field input {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
}
.field input:hover { border-color: var(--text); }
.field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
.helper { margin: 3px 14px 0; font-size: 0.75rem; color: var(--text-secondary); }

.input-wrap { position: relative; }
.input-wrap input[data-reveal] { padding-right: 52px; }
.reveal {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.reveal:hover { background: rgba(0, 0, 0, 0.04); }

.alert {
  padding: 10px 16px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.875rem;
}
.alert-error { background: var(--error); }
.alert-info { background: var(--info); }
.alert-success { background: var(--success); }
.alert-warning { background: var(--warning); color: rgba(0, 0, 0, 0.87); }

/* ----- Login, sign-up and message cards ----- */

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding-top: 32px;
  padding-bottom: 32px;
}
.auth-card { width: 100%; }
.auth-head {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  background: var(--red-gradient);
  color: #fff;
  text-align: center;
}
.auth-head img { display: block; max-height: 60px; width: auto; }
.auth-head h1 { font-size: 2.125rem; font-weight: 600; line-height: 1.235; }
.auth-head p { font-size: 0.875rem; color: rgba(255, 255, 255, 0.9); }
.auth-body { display: grid; gap: 16px; padding: 24px; }
.auth-body hr { margin: 0; }

.message-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
}
.message-card h1 { font-size: 1.5rem; font-weight: 600; color: var(--red); }
.message-card h1.plain { color: var(--text); }
.message-card .alert, .message-card .resend { width: 100%; text-align: left; }

/* ----- Home ----- */

.home { display: grid; justify-items: center; gap: 24px; }

.hero {
  width: 100%;
  max-width: 800px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  text-align: center;
}
.hero h1 {
  margin-bottom: 16px;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--red);
}
.hero p { font-size: 1.25rem; line-height: 1.6; color: var(--text-muted); }

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  margin-top: 24px;
}
@media (min-width: 600px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .features { grid-template-columns: repeat(3, 1fr); } }

.feature {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  padding: 24px;
  text-align: center;
  text-decoration: none;
  transition: box-shadow 0.2s;
}
.feature:hover { box-shadow: var(--elevation-12); }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--red-gradient);
  color: #fff;
}
.feature-icon .icon { width: 36px; height: 36px; }
.feature h2 { font-size: 1.25rem; font-weight: 600; }
.feature p { font-size: 0.875rem; color: var(--text-muted); }

.quick-actions {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 600px;
  margin-top: 8px;
  padding: 24px;
}
.quick-actions h2 {
  margin-bottom: 16px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--red);
  text-align: center;
}
