/* GroupsSUITE corporate identity tokens. */
:root {
  --ink: #0f172a;
  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --indigo-dark: #4f46e5;
  --paper: #ffffff;
  --paper-soft: #f8fafc;
  --paper-line: #e2e8f0;
  --t-900: #0f172a;
  --t-700: #334155;
  --t-600: #475569;
  --t-400: #94a3b8;
  --sky: #0ea5e9;
  /* Signatur-Verlauf der Anmeldung — identisch mit dem Anbieter-Portal
     (activities4fun/groupsactivity), damit die Suite einheitlich wirkt. */
  --brand-grad: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --r: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Zarter Farbschimmer (sky/indigo) über dem hellen Grund — gibt der Seite
     Farbe, ohne die Lesbarkeit der Karten zu stören. */
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(14, 165, 233, .10) 0%, rgba(99, 102, 241, .06) 40%, rgba(248, 250, 252, 0) 72%),
    var(--paper-soft);
  background-attachment: fixed;
  color: var(--t-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header / wordmark */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--paper-line);
}
.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t-900);
}
.wordmark .wm-suite { color: var(--indigo); }
.site-nav { display: flex; align-items: center; gap: 1rem; }
.user-email { color: var(--t-600); font-size: .9rem; }

.site-main { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: var(--r);
  padding: 2rem;
}

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: .95rem; }
.flash-alert { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-notice { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Auth */
.auth-card, .guest-card { max-width: 420px; margin: 3rem auto; }

/* Farbige Anmelde-Karte: Signatur-Verlauf als oberer Balken + weicher, leicht
   indigo getönter Schatten. Der Verlauf sitzt in einem ::before, damit die
   abgerundeten Ecken der Karte erhalten bleiben. */
.auth-card {
  position: relative;
  overflow: hidden;
  border-top: none;
  box-shadow: 0 18px 40px -20px rgba(99, 102, 241, .45), 0 2px 8px rgba(15, 23, 42, .04);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--brand-grad);
}

/* Brand logo (same logo.png as the groupssuite-website repo), served through
   the asset pipeline from app/assets/images/logo.png. Propshaft rewrites the
   relative url() below to the digested path, so there is no hard /logo.png. */
.brand-logo {
  width: 200px;
  height: 52px;
  margin: 0 auto 1.5rem;
  background: url("/assets/logo-b24a3e71.png") center / contain no-repeat;
}

.auth-title {
  margin: 0 0 .25rem;
  font-size: 1.5rem;
  font-weight: 700;
  /* Verlaufs-Schrift als farbiger Akzent; Fallback-Farbe für Browser ohne
     background-clip: text. */
  color: var(--indigo-dark);
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-subtitle {
  margin: 0 0 1.5rem;
  color: var(--t-600);
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
}
.auth-form { display: flex; flex-direction: column; }
.field-label { font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--t-700); }
.field-input {
  padding: .65rem .75rem;
  border: 1px solid var(--paper-line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--t-900);
  margin-bottom: 1.1rem;
}
.field-input::placeholder { color: var(--t-400); }
.field-input:focus { outline: 2px solid var(--indigo-light); border-color: var(--indigo-light); }
.auth-foot { margin: 1.25rem 0 0; font-size: .9rem; }
.auth-foot a { color: var(--indigo); text-decoration: none; }
.auth-foot a:hover { color: var(--indigo-dark); text-decoration: underline; }

/* Buttons */
.btn-primary {
  appearance: none;
  border: none;
  background: var(--brand-grad);
  color: #fff;
  padding: .7rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, .55);
  transition: filter .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn-primary:hover { filter: brightness(1.05) saturate(1.05); box-shadow: 0 10px 22px -6px rgba(99, 102, 241, .6); }
.btn-primary:active { transform: translateY(1px); }
.btn-link {
  appearance: none;
  background: none;
  border: 1px solid var(--paper-line);
  color: var(--t-700);
  padding: .4rem .8rem;
  border-radius: 10px;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
}
.btn-link:hover { background: var(--paper-soft); }

/* Launcher */
.launcher-title { margin: 0 0 .25rem; font-size: 1.6rem; font-weight: 700; }
.launcher-subtitle {
  margin: 0 0 1.75rem;
  color: var(--t-600);
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: var(--r);
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--t-900);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.tile:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, .12);
  transform: translateY(-2px);
  border-color: var(--indigo-light);
}
.tile-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--accent);
}
.tile-name { font-weight: 700; font-size: 1.05rem; }
.tile-desc { color: var(--t-600); font-size: .9rem; margin-top: .35rem; }

.empty-state { color: var(--t-600); }

/* --- GroupsID additions (auth hints + Doorkeeper OIDC consent screens) --- */
.auth-hint { margin: -.6rem 0 1.1rem; font-size: .8rem; color: var(--t-400); }

/* Doorkeeper authorize (consent) screen */
.oauth-app { font-weight: 700; color: var(--indigo-dark); }
.scopes {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: .9rem 1rem;
  background: var(--paper-soft);
  border: 1px solid var(--paper-line);
  border-radius: 10px;
}
.scopes li { color: var(--t-700); font-size: .95rem; padding: .15rem 0; }
.scopes li::before { content: "✓ "; color: var(--indigo); font-weight: 700; }
/* Modul-Starter auf der Startseite. Bewusst eine eigene Klasse: .auth-actions
   stellt die zwei Knöpfe der Zustimmungsseite nebeneinander — dieselbe Reihe
   liess die vier Modulnamen rechts aus der 420 px breiten Karte laufen. Hier
   also eine Spalte, jeder Eintrag über die volle Breite. */
.module-links { display: flex; flex-direction: column; gap: .6rem; margin-top: .4rem; }
.module-links a {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  line-height: 1.4;
}

.auth-actions { display: flex; gap: .75rem; }
.auth-actions form { flex: 1; }
.auth-actions .btn-primary, .auth-actions .btn-secondary { width: 100%; }
.btn-secondary {
  appearance: none;
  border: 1px solid var(--paper-line);
  background: var(--paper);
  color: var(--t-700);
  padding: .7rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 11px;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-secondary:hover { background: var(--paper-soft); }
.redirect-uri { color: var(--t-400); font-size: .8rem; word-break: break-all; }

/* --- Verwaltungsbereich: Konten ----------------------------------------- */

.konten-card { max-width: 1100px; text-align: left; }
.konten-card--schmal { max-width: 640px; }

/* Die Tabelle darf schmal werden, ohne dass die Seite waagrecht scrollt. */
.konten-scroll { overflow-x: auto; }

.konten { width: 100%; border-collapse: collapse; font-size: .9rem; }
.konten th,
.konten td { padding: .55rem .7rem; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.konten th { text-align: left; font-size: .78rem; text-transform: uppercase;
             letter-spacing: .04em; color: var(--t-600); }
.konten tr.ist-geschuetzt { background: #fffbeb; }

.leise { color: var(--t-400); }
.geschuetzt { color: #92400e; }
.nie-benutzt { color: #166534; }

.konten .handlung { white-space: nowrap; }
.konten .handlung form { display: inline; }

/* Löschen ist rot und trotzdem ein Verweis, kein Knopf: Er führt auf die
   Rückfrage und löscht nichts. */
.verweis-loeschen { color: #b91c1c; text-decoration: none; font-size: .85rem; margin-left: .5rem; }
.verweis-loeschen:hover { text-decoration: underline; }

.konto-zeile { font-size: 1.05rem; margin: 0 0 1rem; }

.hinweis { margin-top: 1.1rem; padding: .8rem 1rem; border-radius: var(--r);
           background: var(--paper-soft); border: 1px solid var(--paper-line);
           color: var(--t-700); font-size: .88rem; line-height: 1.5; }
.hinweis--warnung { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* Der einzige Knopf der Oberfläche, der etwas unwiderruflich entfernt. Er sieht
   nicht aus wie die übrigen. */
.btn-gefahr { background: #b91c1c; }
/* .btn-primary:hover legt einen indigofarbenen Schein darunter — an einem roten
   Knopf sieht das nach einem Fehler aus. */
.btn-gefahr:hover { background: #991b1b; box-shadow: 0 10px 22px -6px rgba(185, 28, 28, .5); }

/* Zurück in die Suite. Leiser als "Abmelden": Zurückgehen ist nie die
   wichtigste Handlung einer Seite. */
.site-nav .zurueck { color: var(--t-600); text-decoration: none; font-size: .85rem; font-weight: 600; }
.site-nav .zurueck:hover { color: var(--indigo); }
