/*
 * Bootstrap handles the shared layout, forms, cards, buttons and alerts.
 * Keep this file for app-specific geometry and small visual accents.
 */

@font-face {
  font-family: "Inter var";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/Inter-roman-var.woff2") format("woff2");
}

@font-face {
  font-family: "Inter var";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/Inter-italic-var.woff2") format("woff2");
}

:root {
  --font: "Inter var", "Helvetica Neue", sans-serif;
  --bs-body-font-family: var(--font);
}

html {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "salt", "calt", "case";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  letter-spacing: -0.006em;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
  letter-spacing: 0;
}

.min-w-0 {
  min-width: 0;
}

.auth-card {
  width: min(100%, 600px);
}

.auth-card-scroll {
  max-height: calc(100vh - 8rem);
}

.auth-card-scroll .card-body {
  overflow-y: auto;
}

.auth-logo {
  width: 130px;
}

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, #f5f5f8 22px, #ebecef 22px, #ebecef 24px, transparent 24px, transparent 67px, #ebecef 67px, #ebecef 69px, transparent 69px),
    linear-gradient(225deg, #f5f5f8 22px, #ebecef 22px, #ebecef 24px, transparent 24px, transparent 67px, #ebecef 67px, #ebecef 69px, transparent 69px) 0 64px;
  background-color: #f5f5f8;
  background-size: 64px 128px;
}

.auth-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
}

.auth-brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.auth-form {
  padding-top: 0.5rem;
}

.caption-link {
  color: #6b7280;
  font-size: 0.75rem;
  text-decoration: none;
}

.caption-link:hover {
  color: #635bff;
}

.auth-submit,
.auth-menu-button {
  border-color: #635bff;
  background-color: #635bff;
  font-weight: 600;
}

.auth-submit:hover,
.auth-menu-button:hover {
  border-color: #5148eb;
  background-color: #5148eb;
}

.auth-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0 1rem;
}

.auth-menu-arrow {
  width: 0.55rem;
  height: 0.55rem;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.disclaimer-content p,
.disclaimer-content li {
  font-size: 0.8125rem;
}

.disclaimer-content h2 {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.disclaimer-content h3 {
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.landing-page {
  min-height: 100vh;
}

.landing {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-around;
  gap: 2rem;
  padding: 3rem 1.5rem 2rem;
}

.landing-orbit {
  position: relative;
  width: min(34rem, 76vw, 64vh);
  aspect-ratio: 1;
  margin: 0 auto;
}

.landing-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.orbit-action {
  position: absolute;
  display: grid;
  place-items: center;
  width: 25%;
  aspect-ratio: 1;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #0c6ab6;
  box-shadow: 0 0 0 8px #fff, 0 0 0 13px #15f3e9, 0 18px 32px rgb(15 65 92 / 0.18);
  color: #fff;
  font-size: clamp(0.85rem, 1.8vw, 1.45rem);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.orbit-action:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 0 8px #15f3e9, 0 18px 32px rgb(15 65 92 / 0.24);
}

.orbit-action-login {
  top: -3%;
  left: 37%;
}

.orbit-action-tips {
  top: 40%;
  right: -6%;
}

.orbit-action-register {
  right: 38%;
  bottom: -10%;
}

.orbit-action-disclaimer {
  top: 40%;
  left: -10%;
}

.landing-partners {
  max-width: 980px;
}

.partner-logo {
  max-height: 96px;
  object-fit: contain;
}

.tips-carousel-page {
  min-height: 100vh;
  background: #f5f5f8;
}

.tips-carousel-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
}

.tips-carousel-panel {
  width: min(100%, 960px);
  padding: 2rem 1.5rem;
  background: #40e0d0;
  border-radius: 0.75rem;
}

.tips-carousel-divider {
  width: 100px;
  height: 3px;
  background-color: #fff;
  opacity: 1;
  border: 0;
}

.tips-carousel {
  margin-top: 1.5rem;
}

.tips-carousel-card {
  position: relative;
  width: min(100%, 720px);
  padding: 1.8125rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 1.25rem;
  color: #fff;
}

.tips-carousel-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.tips-carousel-quote {
  line-height: 1.7;
  margin-bottom: 0;
}

.tips-carousel-quote-mark {
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.6);
}

.tips-carousel-arrow {
  width: 0;
  height: 0;
  margin: 1.5rem 0 0.75rem 2rem;
  border-left: 1.5625rem solid transparent;
  border-right: 1.5625rem solid transparent;
  border-top: 1.25rem solid rgba(0, 0, 0, 0.5);
}

.tips-carousel-author {
  margin: 0 0 0 2rem;
  font-size: 1.2rem;
  color: #fff;
}

.tips-carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tips-carousel-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}

.tips-carousel-chevron {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.tips-carousel-chevron-left {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.tips-carousel-chevron-right {
  transform: rotate(45deg);
  margin-right: 4px;
}

.tips-carousel-menu {
  text-align: center;
}

.backend-sidebar {
  width: 280px;
  color: #111827;
  overflow-y: auto;
}

.backend-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid #edf0f5;
}

.backend-brand-link {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #242424;
  text-decoration: none;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.backend-brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.backend-sidebar-mask {
  display: inline-block;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.backend-sidebar-pin {
  width: 18px;
  height: 18px;
  color: #242424;
}

.backend-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 24px 0;
}

.backend-sidebar-section {
  padding: 0 22px 16px;
  color: #5f6475;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.32em;
}

.backend-sidebar-item {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 22px 8px 28px;
  color: #111827;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.backend-sidebar-item:hover,
.backend-sidebar-item.active {
  background: #f6f7fb;
  color: #111827;
}

.backend-sidebar-icon {
  width: 24px;
  height: 24px;
  margin-right: 16px;
  color: #494b74;
}

.backend-sidebar-item:hover .backend-sidebar-icon,
.backend-sidebar-item.active .backend-sidebar-icon {
  color: #635bff;
}

.backend-sidebar-chevron {
  width: 20px;
  height: 20px;
  margin-left: auto;
  color: #494b74;
  transition: transform 160ms ease;
}

.backend-sidebar-dropdown > summary {
  cursor: pointer;
  list-style: none;
}

.backend-sidebar-dropdown > summary::-webkit-details-marker {
  display: none;
}

.backend-sidebar-dropdown[open] > summary .backend-sidebar-chevron {
  transform: rotate(90deg);
}

.backend-sidebar-user {
  position: relative;
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid #edf0f5;
  background: #fff;
}

.backend-sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 6px 8px 6px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.backend-sidebar-user-card:hover {
  background: #f6f7fb;
}

.backend-sidebar-user-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  font-size: 36px;
  line-height: 1;
  color: #635bff;
}

.backend-sidebar-user-text {
  min-width: 0;
  flex: 1;
}

.backend-sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backend-sidebar-user-caret {
  flex: none;
  font-size: 22px;
  color: #5f6475;
  transition: transform 200ms ease;
}

.backend-sidebar-user .backend-sidebar-user-card[aria-expanded="true"] {
  background: #f6f7fb;
}

.backend-sidebar-user .backend-sidebar-user-card[aria-expanded="true"] .backend-sidebar-user-caret {
  transform: rotate(180deg);
}

/* Sortable table headers (powered by Ransack sort_link).
 * Replicates Angular Material's mat-sort-header: column label in uppercase,
 * subtle arrow on hover, solid arrow when active (↑ asc, ↓ desc). */
th.sortable {
  user-select: none;
}

th.sortable a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.03em;
}

th.sortable a::after {
  content: "arrow_upward";
  font-family: "Material Icons";
  font-size: 0.95rem;
  line-height: 1;
  margin-left: 2px;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
  text-transform: none;
  letter-spacing: 0;
}

th.sortable a:hover::after,
th.sortable a:focus::after {
  opacity: 0.4;
}

th.sortable a.asc::after {
  opacity: 1;
}

th.sortable a.desc::after {
  opacity: 1;
  transform: rotate(180deg);
}

.backend-sidebar-subitem {
  padding-left: 56px;
  min-height: 40px;
  font-weight: 400;
  color: #5f6475;
}

.backend-sidebar-subitem .backend-sidebar-icon {
  width: 16px;
  height: 16px;
  margin-right: 12px;
  color: #9aa0b2;
}

.backend-toolbar {
  flex-shrink: 0;
  height: 64px;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
  color: #111827;
  z-index: 1020;
}

.backend-main-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px 0 12px;
  background: #635bff;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.backend-main-menu:hover,
.backend-main-menu:focus {
  background: #554cf2;
  color: #fff;
}

.backend-main-menu-icon {
  width: 20px;
  font-size: 20px;
}

.dashboard-shell {
  min-height: calc(100vh - 129px);
}

.dashboard-title {
  font-size: 3.5rem;
  line-height: 1.2;
}

.dashboard-tabs {
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.dashboard-tab {
  min-height: 132px;
  color: #111827;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dashboard-tab:hover,
.dashboard-tab.active {
  border-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  transform: translateY(-2px);
}

.dashboard-icon {
  color: var(--bs-primary);
  font-size: 3rem;
  line-height: 1;
}

.dashboard-icon-circle {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-size: 1.6rem;
}

.dashboard-stat-card {
  transition: box-shadow 200ms ease;
}

.dashboard-stat-card:hover {
  box-shadow: 0 10px 25px rgba(17, 24, 39, 0.12) !important;
}

.dashboard-stat-card--best-team {
  background: #ebba3f;
}

.dashboard-stat-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(99, 91, 255, 0.1);
  color: #635bff;
}

.dashboard-stat-icon .material-icons {
  font-size: 1.75rem;
  line-height: 1;
}

.dashboard-stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6c757d;
  letter-spacing: 0.02em;
}

.dashboard-stat-team-column {
  border-right: 1px solid rgba(0, 0, 0, 0.5);
}

@media (max-width: 860px) {
  .backend-sidebar {
    display: none !important;
  }

  .dashboard-title {
    font-size: 2.75rem;
  }

  .landing {
    justify-content: center;
    padding: 2rem 1rem;
  }

  .landing-orbit {
    width: min(28rem, 82vw);
  }
}
