/* Applish UI — design system styles
 * Previously inlined in shared/_applish_head.html.erb
 * Served via Propshaft as a standalone stylesheet
 */

.applish-ui {
  --applish-ink: #0b1220;
  --applish-muted: #526072;
  --applish-accent: #1587ff;
  --applish-accent-strong: #0f6bdc;
  --applish-mint: #2dd4bf;
  --applish-surface: rgba(255, 255, 255, 0.72);
  --applish-border: rgba(15, 23, 42, 0.12);
  --applish-grid: rgba(15, 23, 42, 0.08);
  --applish-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
  --applish-shell-bg: radial-gradient(circle at 10% 10%, rgba(45, 212, 191, 0.22), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(21, 135, 255, 0.2), transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.95));
  --applish-orb-mint: rgba(45, 212, 191, 0.45);
  --applish-orb-sky: rgba(21, 135, 255, 0.35);
  --applish-orb-sun: rgba(251, 191, 36, 0.3);
  font-family: "Manrope", "Helvetica Neue", sans-serif;
  color: var(--applish-ink);
}

.dark .applish-ui {
  --applish-ink: #e2e8f0;
  --applish-muted: #94a3b8;
  --applish-surface: rgba(15, 23, 42, 0.7);
  --applish-border: rgba(148, 163, 184, 0.2);
  --applish-grid: rgba(148, 163, 184, 0.18);
  --applish-shadow: 0 30px 80px rgba(2, 6, 23, 0.6);
  --applish-shell-bg: radial-gradient(circle at 10% 10%, rgba(45, 212, 191, 0.2), transparent 60%),
    radial-gradient(circle at 80% 0%, rgba(21, 135, 255, 0.25), transparent 55%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.98));
  --applish-orb-mint: rgba(45, 212, 191, 0.25);
  --applish-orb-sky: rgba(21, 135, 255, 0.3);
  --applish-orb-sun: rgba(251, 191, 36, 0.22);
}

body.applish-ui {
  background-image:
    radial-gradient(circle at 12% 8%, var(--applish-orb-mint) 0%, transparent 55%),
    radial-gradient(circle at 90% 0%, var(--applish-orb-sky) 0%, transparent 50%),
    radial-gradient(circle at 40% 95%, var(--applish-orb-sun) 0%, transparent 60%),
    radial-gradient(var(--applish-grid) 1px, transparent 1px),
    var(--applish-shell-bg);
  background-size: auto, auto, auto, 28px 28px, auto;
  background-attachment: fixed;
}

.dark body.applish-ui {
  background-image:
    radial-gradient(circle at 12% 8%, var(--applish-orb-mint) 0%, transparent 55%),
    radial-gradient(circle at 90% 0%, var(--applish-orb-sky) 0%, transparent 50%),
    radial-gradient(circle at 40% 95%, var(--applish-orb-sun) 0%, transparent 60%),
    radial-gradient(var(--applish-grid) 1px, transparent 1px),
    var(--applish-shell-bg);
}

.applish-backdrop {
  position: absolute;
  inset: 0;
  background: var(--applish-shell-bg);
  overflow: hidden;
}

.applish-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--applish-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
}

.applish-orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  filter: blur(35px);
  opacity: 0.75;
}

.applish-orb--mint { background: var(--applish-orb-mint); }
.applish-orb--sky { background: var(--applish-orb-sky); }
.applish-orb--sun { background: var(--applish-orb-sun); }

.applish-card {
  background: var(--applish-surface);
  border: 1px solid var(--applish-border);
  border-radius: 1.5rem;
  box-shadow: var(--applish-shadow);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.applish-title {
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.applish-muted { color: var(--applish-muted); }

.applish-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(21, 135, 255, 0.2);
  background: rgba(21, 135, 255, 0.12);
  color: var(--applish-accent);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.applish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.7rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgb(var(--brand-r), var(--brand-g), var(--brand-b)) !important;
  color: #000 !important;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  min-height: 44px;
}

.applish-btn * { color: #000 !important; }

.applish-btn:hover {
  transform: translateY(-1px);
  background: rgb(var(--brand-strong-r), var(--brand-strong-g), var(--brand-strong-b)) !important;
  color: #000 !important;
  box-shadow: 0 6px 16px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35);
}

.applish-btn:hover * { color: #000 !important; }

.applish-btn:focus-visible {
  outline: 3px solid rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.5);
  outline-offset: 2px;
}

.applish-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--applish-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--applish-ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dark .applish-btn-ghost { background: rgba(15, 23, 42, 0.6); }

.applish-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--applish-border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--applish-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dark .applish-input { background: rgba(15, 23, 42, 0.7); }

.applish-input:focus {
  outline: none;
  border-color: rgba(21, 135, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(21, 135, 255, 0.2);
}

.applish-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--applish-muted);
  margin-bottom: 0.5rem;
}

.applish-checkbox {
  accent-color: var(--applish-accent);
  width: 1rem;
  height: 1rem;
}

.applish-link {
  color: var(--applish-accent);
  font-weight: 600;
  transition: color 0.2s ease;
}

.applish-link:hover { color: var(--applish-accent-strong); }

.applish-link-danger {
  color: #dc2626;
  font-weight: 600;
  transition: color 0.2s ease;
}

.applish-link-danger:hover { color: #b91c1c; }

body.applish-ui .applish-ui a {
  color: var(--applish-accent);
  text-decoration: none;
}

body.applish-ui .applish-ui a:hover { color: var(--applish-accent-strong); }

body.applish-ui .applish-ui h1,
body.applish-ui .applish-ui h2,
body.applish-ui .applish-ui h3,
body.applish-ui .applish-ui h4,
body.applish-ui .applish-ui h5,
body.applish-ui .applish-ui h6 {
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  color: var(--applish-ink);
  letter-spacing: -0.02em;
}

body.applish-ui .applish-ui p { color: var(--applish-muted); }

body.applish-ui .applish-ui input:not([type="checkbox"]):not([type="radio"]),
body.applish-ui .applish-ui select,
body.applish-ui .applish-ui textarea {
  border-radius: 0.9rem;
  border: 1px solid var(--applish-border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--applish-ink);
  padding: 0.7rem 0.9rem;
}

.dark body.applish-ui .applish-ui input:not([type="checkbox"]):not([type="radio"]),
.dark body.applish-ui .applish-ui select,
.dark body.applish-ui .applish-ui textarea {
  background: rgba(15, 23, 42, 0.7);
  color: var(--applish-ink);
}

body.applish-ui .glass,
body.applish-ui .applish-card {
  background: var(--applish-surface);
  border: 1px solid var(--applish-border);
  border-radius: 1.5rem;
  box-shadow: var(--applish-shadow);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

body.applish-ui .section-muted {
  background: rgba(255, 255, 255, 0.45);
  border-top: 1px solid var(--applish-border);
  border-bottom: 1px solid var(--applish-border);
}

.dark body.applish-ui .section-muted { background: rgba(15, 23, 42, 0.55); }

body.applish-ui .btn-primary,
body.applish-ui .applish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.7rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgb(var(--brand-r), var(--brand-g), var(--brand-b)) !important;
  color: #000 !important;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  min-height: 44px;
}

body.applish-ui .btn-primary *,
body.applish-ui .applish-btn * { color: #000 !important; }

body.applish-ui .btn-primary:hover,
body.applish-ui .applish-btn:hover {
  transform: translateY(-1px);
  background: rgb(var(--brand-strong-r), var(--brand-strong-g), var(--brand-strong-b)) !important;
  color: #000 !important;
  box-shadow: 0 6px 16px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35);
}

body.applish-ui .btn-primary:hover *,
body.applish-ui .applish-btn:hover * { color: #000 !important; }

body.applish-ui .btn-primary:focus-visible,
body.applish-ui .applish-btn:focus-visible {
  outline: 3px solid rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.5);
  outline-offset: 2px;
}

body.applish-ui .btn-outline-brand,
body.applish-ui .applish-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--applish-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--applish-ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dark body.applish-ui .btn-outline-brand,
.dark body.applish-ui .applish-btn-ghost { background: rgba(15, 23, 42, 0.6); }

body.applish-ui .text-theme { color: var(--applish-ink); }
body.applish-ui .text-muted { color: var(--applish-muted); }
body.applish-ui .text-brand { color: var(--applish-accent); }
body.applish-ui .text-applish-accent { color: var(--applish-accent); }

body.applish-ui .pricing-dark-panel {
  color: #f8fafc;
}

body.applish-ui .pricing-dark-panel h1,
body.applish-ui .pricing-dark-panel h2,
body.applish-ui .pricing-dark-panel h3,
body.applish-ui .pricing-dark-panel h4,
body.applish-ui .pricing-dark-panel h5,
body.applish-ui .pricing-dark-panel h6 {
  color: #f8fafc;
}

body.applish-ui .pricing-dark-panel p,
body.applish-ui .pricing-dark-panel li,
body.applish-ui .pricing-dark-panel span {
  color: inherit;
}

body.applish-ui .pricing-dark-panel .text-slate-100,
body.applish-ui .pricing-dark-panel .text-slate-200,
body.applish-ui .pricing-dark-panel .text-white {
  color: #f8fafc;
}

body.applish-ui .pricing-dark-panel .text-slate-300,
body.applish-ui .pricing-dark-panel .text-slate-400,
body.applish-ui .pricing-dark-panel .text-slate-500 {
  color: #cbd5e1;
}

body.applish-ui .pricing-dark-panel .text-amber-200,
body.applish-ui .pricing-dark-panel .text-amber-300 {
  color: #fde68a;
}

body.applish-ui .pricing-dark-panel .text-emerald-100,
body.applish-ui .pricing-dark-panel .text-emerald-200 {
  color: #d1fae5;
}

body.applish-ui .pricing-dark-panel a {
  color: #f8fafc;
}

body.applish-ui .pricing-dark-panel .pricing-primary-action,
body.applish-ui .pricing-dark-panel .pricing-primary-action:hover {
  color: #ffffff !important;
}

body.applish-ui .pricing-dark-panel .pricing-secondary-action,
body.applish-ui .pricing-dark-panel .pricing-secondary-action:hover {
  color: #bfdbfe !important;
}

body.applish-ui .pricing-dark-panel .pricing-price {
  color: #e2e8f0;
}

body.applish-ui .max-w-4xl,
body.applish-ui .max-w-5xl,
body.applish-ui .max-w-6xl { max-width: 80rem; }

body.applish-ui *:focus-visible {
  outline: 2px solid rgba(21, 135, 255, 0.6);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.applish-divider {
  height: 1px;
  background: var(--applish-border);
  border: none;
}

.applish-table { width: 100%; border-collapse: collapse; }

.applish-table th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--applish-muted);
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--applish-border);
}

.applish-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--applish-border);
  font-size: 0.95rem;
}

.applish-table tbody tr:hover { background: rgba(21, 135, 255, 0.06); }

.applish-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.applish-role-admin   { color: #0f766e; background: rgba(45, 212, 191, 0.18); border-color: rgba(45, 212, 191, 0.4); }
.applish-role-root    { color: #92400e; background: rgba(251, 191, 36, 0.2);  border-color: rgba(251, 191, 36, 0.4); }
.applish-role-secretary { color: #1d4ed8; background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); }
.applish-role-staff   { color: #0f172a; background: rgba(148, 163, 184, 0.18); border-color: rgba(148, 163, 184, 0.35); }
.applish-role-student { color: #334155; background: rgba(226, 232, 240, 0.8);  border-color: rgba(148, 163, 184, 0.35); }

.applish-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--applish-border);
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--applish-ink);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dark .applish-chip { background: rgba(15, 23, 42, 0.6); }

.applish-user-panel {
  border: 1px solid rgba(21, 135, 255, 0.25);
  background: linear-gradient(135deg, rgba(21, 135, 255, 0.08), rgba(45, 212, 191, 0.08));
  box-shadow: 0 18px 40px rgba(21, 135, 255, 0.12);
}

.dark .applish-user-panel {
  border-color: rgba(21, 135, 255, 0.3);
  background: linear-gradient(135deg, rgba(21, 135, 255, 0.16), rgba(45, 212, 191, 0.12));
}

.applish-user-field {
  border-left: 3px solid rgba(21, 135, 255, 0.6);
  background: rgba(21, 135, 255, 0.08);
}

.dark .applish-user-field { background: rgba(21, 135, 255, 0.12); }

.applish-user-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(21, 135, 255, 0.25);
  background: rgba(21, 135, 255, 0.12);
  color: var(--applish-accent);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.applish-user-value { color: var(--applish-ink); font-weight: 600; }
.applish-user-chip  { border-color: rgba(21, 135, 255, 0.35); background: rgba(21, 135, 255, 0.12); color: var(--applish-accent); }
.applish-chip-active { border-color: rgba(21, 135, 255, 0.5); color: var(--applish-accent); }

.applish-fade-up { animation: applish-fade-up 0.8s ease both; }

.applish-stagger > * {
  animation: applish-fade-up 0.8s ease both;
  animation-delay: calc(var(--i, 0) * 120ms);
}

.applish-float { animation: applish-float 9s ease-in-out infinite; }

@keyframes applish-fade-up {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes applish-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-16px); }
}

@media (prefers-reduced-motion: reduce) {
  .applish-fade-up,
  .applish-stagger > *,
  .applish-float { animation: none; }
}
