@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700&display=swap');

:root {
  --bg: #0f1115;
  --bg-accent: #161a22;
  --ink: #e6e9ef;
  --muted: #9aa4b2;
  --primary: #5865f2;
  --primary-dark: #4752c4;
  --card: #1b1f27;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  --glow-primary: 0 0 18px rgba(88, 101, 242, 0.45);
  --glow-soft: 0 0 30px rgba(88, 101, 242, 0.18);
  --page-bg: radial-gradient(circle at top right, #1f2532 0%, #0f1115 60%);
  --shape-left: #1a2030;
  --shape-right: #20283a;
  --surface-glass: rgba(17, 20, 28, 0.8);
  --input-bg: #141a24;
  --chip-bg: rgba(88, 101, 242, 0.16);
  --progress-track: rgba(255, 255, 255, 0.1);
  --progress-fill: linear-gradient(90deg, #5865f2, #8ea1ff);
  --status-studying: #38bdf8;
  --status-online: #22c55e;
  --status-idle: #f59e0b;
  --status-dnd: #ef4444;
}

.theme-light {
  --bg: #f5f7fb;
  --bg-accent: #eef1f6;
  --ink: #1f2430;
  --muted: #5e6775;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --card: #ffffff;
  --border: rgba(31, 36, 48, 0.08);
  --shadow: 0 20px 40px rgba(31, 36, 48, 0.12);
  --glow-primary: 0 0 16px rgba(79, 70, 229, 0.35);
  --glow-soft: 0 0 26px rgba(79, 70, 229, 0.16);
  --page-bg: radial-gradient(circle at top right, #e6ecff 0%, #f5f7fb 60%);
  --shape-left: #dde6ff;
  --shape-right: #f0e7ff;
  --surface-glass: rgba(255, 255, 255, 0.75);
  --input-bg: #ffffff;
  --chip-bg: #eef1ff;
  --progress-track: rgba(31, 36, 48, 0.08);
  --progress-fill: linear-gradient(90deg, #4f46e5, #6ee7ff);
  --status-studying: #0ea5e9;
  --status-online: #16a34a;
  --status-idle: #f59e0b;
  --status-dnd: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  min-height: 100vh;
  animation: pageFade 0.7s ease both;
}

h1, h2, h3 {
  margin: 0 0 0.5rem 0;
  font-family: 'Sora', 'Manrope', sans-serif;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.has-members .container {
  padding-right: 280px;
}

.page-auth .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  align-items: center;
  padding-top: 6rem;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(0);
  z-index: -1;
  opacity: 0.9;
  animation: slowFloat 14s ease-in-out infinite;
}

.bg-shape--left {
  width: 420px;
  height: 420px;
  background: var(--shape-left);
  top: -120px;
  left: -160px;
}

.bg-shape--right {
  width: 360px;
  height: 360px;
  background: var(--shape-right);
  bottom: -140px;
  right: -120px;
  animation-delay: -6s;
}

.auth-hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.feature-list li {
  padding: 0.75rem 1rem;
  background: var(--bg-accent);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(88, 101, 242, 0.35);
  box-shadow: var(--shadow), var(--glow-soft);
}

.stack {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.field input,
.field select {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--ink);
}

.file-input {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--input-bg);
  cursor: pointer;
}

.file-input input[type="file"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.file-button {
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.file-name {
  font-size: 0.9rem;
  color: var(--muted);
}

.field input:focus,
.field select:focus,
.table input:focus,
.table select:focus {
  outline: 2px solid rgba(88, 101, 242, 0.35);
  outline-offset: 2px;
}

.btn {
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(88, 101, 242, 0.35);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(88, 101, 242, 0.45);
}

.btn.primary::after {
  content: "";
  margin-left: 0.6rem;
  width: 0;
  height: 0;
  border-left: 6px solid rgba(255, 255, 255, 0.9);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.btn.primary:hover::after {
  transform: translateX(2px);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.tab-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tab.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.tab-content.is-hidden {
  display: none;
}

.tab-content {
  min-height: 320px;
}

.alert {
  margin-top: 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--bg-accent);
  border: 1px solid var(--border);
  min-height: 2.5rem;
  color: var(--muted);
}

.alert:empty {
  display: none;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 4vw;
  border-bottom: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, #8ea1ff, #5865f2);
  box-shadow: var(--glow-primary);
  transform: rotate(45deg);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mini-progress {
  display: grid;
  gap: 0.3rem;
  width: 140px;
}

.mini-progress .progress {
  height: 6px;
}

.greeting-link {
  color: var(--muted);
  font-weight: 600;
}

.greeting-link:hover {
  color: var(--ink);
}

.section-header {
  margin-bottom: 2rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.nav-card {
  display: grid;
  gap: 0.8rem;
  transition: transform 0.2s ease;
}

.nav-card:hover {
  transform: translateY(-4px);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.progress {
  width: 100%;
  height: 10px;
  background: var(--progress-track);
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--progress-fill);
  width: 0%;
  box-shadow: var(--glow-soft);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.table input,
.table select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

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

.profile-summary {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #7c86ff, #5865f2);
  object-fit: cover;
  box-shadow: var(--glow-soft);
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.user-dock {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  z-index: 12;
  min-width: 230px;
}

.user-dock__avatar-wrap {
  position: relative;
}

.user-dock__avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, #7c86ff, #5865f2);
  box-shadow: var(--glow-soft);
}

.user-dock__dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid var(--card);
  background: var(--status-online);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}

.user-dock__meta {
  display: grid;
  gap: 0.2rem;
}

.user-dock__name {
  font-weight: 600;
  margin: 0;
}

.user-dock__id {
  margin: 0;
  font-size: 0.85rem;
}

.user-dock__activity {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-dock__status {
  font-weight: 600;
  color: var(--ink);
}

.user-dock__divider {
  color: var(--muted);
}

.user-dock__badge-row {
  margin-top: 0.3rem;
}

.user-dock__status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid #2f3136;
  background: #1f2125;
  color: #e3e5e8;
}

.user-dock__status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--status-studying);
}

.user-dock__status-badge[data-status="online"]::before {
  background: var(--status-online);
}

.user-dock__status-badge[data-status="idle"]::before {
  background: var(--status-idle);
}

.user-dock__status-badge[data-status="dnd"]::before {
  background: var(--status-dnd);
}

.user-dock__status-badge[data-status="studying"]::before {
  background: var(--status-studying);
}

.quick-profile__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 12;
  animation: pageFade 0.2s ease both;
}

.members {
  position: fixed;
  right: 1.5rem;
  top: 6rem;
  width: 220px;
  max-height: calc(100vh - 8rem);
  overflow: auto;
  background: #2b2d31;
  border: 1px solid #1e1f22;
  border-radius: 16px;
  padding: 0.8rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  z-index: 9;
}

.members__header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #2b2d31;
  padding: 0.2rem 0 0.6rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #f2f3f5;
}

.members__section + .members__section {
  margin-top: 1rem;
}

.members__title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5a9b0;
}

.members__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.members__item {
  display: grid;
  grid-template-columns: 10px 1fr;
  column-gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
  color: #e3e5e8;
}

.members__item:hover {
  background: rgba(88, 101, 242, 0.12);
}

.members__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #3ba55d;
  justify-self: center;
}

.members__dot[data-status="studying"] {
  background: var(--status-studying);
}

.members__dot[data-status="online"] {
  background: var(--status-online);
}

.members__dot[data-status="idle"] {
  background: var(--status-idle);
}

.members__dot[data-status="dnd"] {
  background: var(--status-dnd);
}

.members__dot[data-status="offline"] {
  background: #4f545c;
}

.members__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.members__tag {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: #a5a9b0;
}

.members__empty {
  color: #8b8f97;
  font-size: 0.85rem;
  padding: 0.35rem 0.4rem;
}

.quick-profile {
  position: fixed;
  left: 1.5rem;
  bottom: 6.5rem;
  width: min(320px, 90vw);
  background: #232428;
  border: 1px solid #2f3136;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 18px rgba(88, 101, 242, 0.18);
  padding: 0 1rem 1rem;
  z-index: 13;
  animation: rise 0.25s ease both;
  overflow: hidden;
}

.quick-profile__banner {
  height: 64px;
  margin: 0 -1rem 0.5rem;
  background: linear-gradient(135deg, #5865f2 0%, #3b43a8 45%, #2b2f36 100%);
}

.quick-profile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  margin-top: -36px;
}

.quick-profile__identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.quick-profile__avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 4px solid #232428;
  background: linear-gradient(135deg, #7c86ff, #5865f2);
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.quick-profile__title {
  margin: 0;
  font-weight: 700;
}

.quick-profile__handle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.quick-profile__close {
  border: none;
  background: #2b2f36;
  color: #fff;
  font-size: 1.1rem;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.quick-profile__close:hover {
  transform: scale(1.05);
  background: #5865f2;
}

.quick-profile__body {
  display: grid;
  gap: 0.8rem;
}

.quick-profile .field input,
.quick-profile .field select {
  background: #1f2125;
  border: 1px solid #2f3136;
  color: #e3e5e8;
}

.quick-profile__select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #b5bac1 50%),
    linear-gradient(135deg, #b5bac1 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 12px) 52%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.quick-profile__actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.timer-card {
  text-align: center;
}

.timer-display {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 1rem 0 1.5rem;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.stat {
  font-size: 2rem;
  font-weight: 700;
}

.theme-panel {
  display: grid;
  gap: 1rem;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.theme-option {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  background: var(--bg-accent);
  display: grid;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.theme-option:hover {
  transform: translateY(-2px);
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option .preview {
  height: 64px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #1f2532, #0f1115);
}

.theme-option.light .preview {
  background: linear-gradient(135deg, #e6ecff, #f5f7fb);
}

.theme-option span {
  font-weight: 600;
}

.theme-option.is-active {
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(88, 101, 242, 0.2);
}

.auth-hero,
.auth-panel,
.card,
.nav-card {
  animation: rise 0.6s ease both;
}

.auth-panel {
  animation-delay: 0.05s;
}

.nav-card:nth-child(2) {
  animation-delay: 0.05s;
}

.nav-card:nth-child(3) {
  animation-delay: 0.1s;
}

@keyframes pageFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slowFloat {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
  100% {
    transform: translateY(0px);
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    gap: 0.8rem;
  }

  .container {
    padding-top: 3rem;
  }

  .user-dock {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    min-width: 0;
  }

  .quick-profile {
    left: 1rem;
    right: 1rem;
    bottom: 6rem;
  }

  .members {
    display: none;
  }

  .has-members .container {
    padding-right: 0;
  }
}
