/* BreakBook · Lumina shell — tokens + components + admin/login layout */
@import url('/assets/css/bb-tokens.css');
@import url('/assets/css/bb-components.css');

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg-canvas);
  color: var(--text-body);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-blue); }
svg { display: block; }

/* Admin shell — no glass, no ambient glow */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background: var(--bg-body);
}
aside.sidebar {
  width: 240px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--zinc-200);
  display: flex;
  flex-direction: column;
  padding: 20px 12px 16px;
  flex-shrink: 0;
}
.brand-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--zinc-100);
  margin-bottom: 12px;
}
.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: none;
  overflow: hidden;
}
.brand-mark svg { width: 32px; height: 32px; }
.brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--zinc-900);
  letter-spacing: -0.02em;
}
.brand-text span { font-size: 11px; color: var(--zinc-400); }

.nav-group-label {
  font-size: 11px;
  color: var(--zinc-400);
  padding: 10px 10px 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.nav-item {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--zinc-500);
  cursor: pointer;
  transition: all 0.2s var(--ease-ui);
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}
.nav-item:hover {
  color: var(--zinc-900);
  background: var(--zinc-50);
}
.nav-item.active {
  color: var(--zinc-900);
  background: var(--zinc-100);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--brand-blue);
  border-radius: 1px;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; flex-shrink: 0; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding-right: 2px; }
.sidebar-footer {
  border-top: 1px solid var(--zinc-100);
  padding-top: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--zinc-500);
}
.sidebar-footer a { color: var(--zinc-600); }
.sidebar-footer a:hover { color: var(--zinc-900); text-decoration: underline; text-underline-offset: 3px; }

main.workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--zinc-200);
  background: var(--bg-surface);
}
.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--zinc-900);
  letter-spacing: -0.03em;
}
.topbar .sub { font-size: 12px; color: var(--zinc-400); margin-top: 2px; }
.content { flex: 1; overflow: auto; padding: 24px 28px 40px; }

@media (max-width: 960px) {
  aside.sidebar { display: none; }
}

/* Login — cinematic */
body.login-page {
  background: var(--bg-body);
  color: var(--zinc-900);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  perspective: 2500px;
}
body.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--zinc-200) 1px, transparent 1px),
    linear-gradient(to bottom, var(--zinc-200) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 0%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black 10%, transparent 70%);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

.login-app {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateZ(-1500px) translateY(200px) rotateX(25deg) scale(0.8);
  filter: blur(20px);
  animation: cinematic-emerge 1.6s var(--ease-cinematic) forwards;
  transform-style: preserve-3d;
}
@keyframes cinematic-emerge {
  0% { opacity: 0; transform: translateZ(-1500px) translateY(200px) rotateX(25deg) scale(0.8); filter: blur(20px); }
  40% { opacity: 0.8; filter: blur(0); }
  100% { opacity: 1; transform: translateZ(0) translateY(0) rotateX(0) scale(1); filter: blur(0); }
}

.login-card-v2 {
  background: var(--bg-surface);
  width: 100%;
  max-width: 420px;
  padding: 3.5rem 3rem;
  border-radius: 20px;
  border: 1px solid rgba(228, 228, 231, 0.6);
  box-shadow: var(--shadow-refined);
}

.stagger-el {
  opacity: 0;
  transform: translateY(16px);
  animation: slide-up-fade 0.8s var(--ease-cinematic) forwards;
}
.d-1 { animation-delay: 0.3s; }
.d-2 { animation-delay: 0.4s; }
.d-3 { animation-delay: 0.5s; }
.d-4 { animation-delay: 0.6s; }
.d-5 { animation-delay: 0.7s; }
.d-6 { animation-delay: 0.8s; }
@keyframes slide-up-fade {
  100% { opacity: 1; transform: translateY(0); }
}

.login-logo-wrap {
  width: 44px;
  height: 44px;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zinc-50);
  border: 1px solid var(--zinc-200);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.login-logo-wrap svg { width: 28px; height: 28px; }

.login-header { margin-bottom: 2.5rem; }
.login-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
  color: var(--zinc-900);
}
.login-subtitle {
  font-size: 0.95rem;
  color: var(--zinc-500);
  line-height: 1.5;
}

.login-form { display: flex; flex-direction: column; gap: 1.5rem; }
.login-form .input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.login-form .label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.login-form .label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--zinc-500);
  transition: color 0.3s;
  margin: 0;
}
.login-form .input-group:focus-within .label { color: var(--zinc-900); }

.login-form .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.login-form .input {
  width: 100%;
  height: 2.75rem;
  padding: 0 1rem;
  font-size: 0.95rem;
  color: var(--zinc-900);
  background: var(--bg-surface);
  border: 1px solid var(--zinc-200);
  border-radius: 10px;
  outline: none;
  transition: all 0.3s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  font-family: inherit;
}
.login-form .input::placeholder { color: var(--zinc-400); }
.login-form .input:hover { border-color: var(--zinc-300); }
.login-form .input:focus {
  border-color: var(--zinc-400);
  box-shadow: 0 0 0 1px var(--zinc-300);
}
.login-form .input-group.has-error .input { border-color: #f87171; }
.login-form .input-group.has-error .input:focus {
  border-color: var(--rose-500);
  box-shadow: 0 0 0 1px #f87171;
}
.login-form .input-group.has-error .label { color: var(--rose-600) !important; }
.login-form .error-msg {
  font-size: 12px;
  color: var(--rose-600);
  display: none;
}
.login-form .input-group.has-error .error-msg { display: block; }

.btn-icon {
  position: absolute;
  right: 0.25rem;
  height: 2.25rem;
  width: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--zinc-400);
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-icon:hover { color: var(--zinc-900); background: var(--zinc-100); }

.login-submit {
  width: 100%;
  height: 2.75rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s var(--ease-ui);
  background: var(--zinc-900);
  color: #fff;
  margin-top: 0.5rem;
  position: relative;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.login-submit:hover { background: var(--zinc-800); }
.login-submit:active { transform: scale(0.98); }
.login-submit .btn-text {
  grid-area: 1 / 1;
  transition: all 0.4s;
  opacity: 1;
  transform: scale(1);
}
.login-submit .btn-spinner {
  grid-area: 1 / 1;
  transition: all 0.4s;
  opacity: 0;
  transform: scale(0.8) rotate(-45deg);
  width: 18px;
  height: 18px;
  color: #fff;
}
.login-submit.is-loading { pointer-events: none; opacity: 0.9; }
.login-submit.is-loading .btn-text { opacity: 0; transform: scale(0.95); }
.login-submit.is-loading .btn-spinner {
  opacity: 1;
  transform: scale(1) rotate(0);
  animation: bbPureSpin 0.8s linear infinite;
}

.login-note-v2 {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 12px;
  color: var(--zinc-400);
  line-height: 1.5;
}
.login-brand-foot {
  margin-top: 2rem;
  text-align: center;
  font-size: 12px;
  color: var(--zinc-400);
  letter-spacing: 0.04em;
}

@media (max-width: 520px) {
  body.login-page { overflow: auto; padding: 24px 16px; }
  .login-card-v2 { padding: 2.5rem 1.5rem; }
}

.login-aurora,
.ambient-glow { display: none !important; }
