/* RADIANCE VAULT — user portal layout */

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.boot-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.94);
  }
}

/* ---------- App shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
}
.sidebar .brand {
  padding: 4px 8px 10px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 14px 12px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14.5px;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav a.active {
  background: var(--gold-soft);
  color: var(--text);
}
.nav a.active .icon {
  color: var(--gold-text);
}
.nav a.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.nav a .ext {
  margin-left: auto;
  opacity: 0.5;
}
.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.user-chip:hover {
  border-color: var(--border-strong);
}
.user-chip .who {
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.user-chip .who b {
  display: block;
  font-size: 14px;
}
.user-chip .who span {
  font-size: 12px;
  color: var(--muted);
}
.user-chip + .menu {
  bottom: calc(100% + 6px);
  top: auto;
  left: 0;
  right: 0;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: none;
}
.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head h1 {
  font-size: 30px;
}
.page-head .lead {
  margin-top: 6px;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: 284px;
    transform: translateX(-102%);
    transition: transform 0.22s var(--ease);
    box-shadow: var(--shadow-pop);
  }
  .shell.drawer-open .sidebar {
    transform: none;
  }
  .drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.5);
  }
  .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    height: 60px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
  }
  .topbar .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  .topbar .brand-text .v {
    font-size: 15px;
  }
  .page {
    padding: 22px 16px 56px;
  }
  .page-head h1 {
    font-size: 25px;
  }
}

/* ---------- Auth layout ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(1200px 600px at 0% 100%, rgba(246, 198, 60, 0.16), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(246, 198, 60, 0.07), transparent 60%),
    #0b0c0f;
  color: #f4f5f7;
  border-right: 1px solid #1e2027;
}
.auth-visual .brand-text .v {
  color: #f4f5f7;
}
.auth-visual .brand-text .k {
  color: #f6c63c;
}
.auth-visual::after {
  content: '';
  position: absolute;
  right: -180px;
  bottom: -180px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  border: 1px solid rgba(246, 198, 60, 0.18);
  box-shadow:
    0 0 0 60px rgba(246, 198, 60, 0.025),
    0 0 0 120px rgba(246, 198, 60, 0.02),
    0 0 0 180px rgba(246, 198, 60, 0.015);
  pointer-events: none;
}
.auth-visual .dial {
  position: absolute;
  right: -40px;
  bottom: 70px;
  width: 220px;
  height: 220px;
  opacity: 0.9;
  color: rgba(246, 198, 60, 0.55);
}
.auth-pitch {
  position: relative;
  z-index: 1;
  max-width: 460px;
}
.auth-pitch h1 {
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 16px 0 14px;
}
.auth-pitch h1 em {
  font-style: normal;
  color: #f6c63c;
}
.auth-pitch p {
  color: #b9bdc6;
  font-size: 16px;
}
.auth-points {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 30px;
}
.auth-points div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #c9ccd3;
  font-size: 14.5px;
}
.auth-points .icon {
  color: #f6c63c;
  margin-top: 2px;
}
.auth-legal {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  color: #6c727e;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.auth-card {
  width: min(440px, 100%);
}
.auth-card.wide {
  width: min(560px, 100%);
}
.auth-card .card {
  padding: 30px;
}
.auth-card h2 {
  font-size: 24px;
}
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.steps .s {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--faint);
}
.steps .s .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  font-size: 11.5px;
}
.steps .s.done {
  color: var(--muted);
}
.steps .s.done .n {
  background: var(--green-soft);
  border-color: transparent;
  color: var(--green);
}
.steps .s.current {
  color: var(--text);
}
.steps .s.current .n {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: transparent;
}
.steps .bar {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
  min-width: 12px;
}
.app-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 650;
}
.app-pill i {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-ink);
}
.method-choice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.method-choice:hover {
  border-color: var(--gold-line);
  background: var(--surface-2);
}
.method-choice .t {
  font-weight: 700;
  margin-bottom: 3px;
}
.method-choice .d {
  font-size: 13.5px;
  color: var(--muted);
}
.method-choice .rec {
  margin-left: auto;
}
.qr-box {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.qr {
  width: 156px;
  height: 156px;
  flex: none;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.secret {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  word-break: break-all;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
}
.key-visual {
  display: grid;
  place-items: center;
  height: 120px;
  border-radius: var(--radius);
  background: radial-gradient(240px 120px at 50% 100%, var(--gold-soft), transparent 70%), var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--gold-text);
}
.key-visual .icon {
  width: 46px;
  height: 46px;
}
.key-visual.waiting .icon {
  animation: pulse 1.2s ease-in-out infinite;
}
.success-burst {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  background: var(--green-soft);
  color: var(--green);
}
.success-burst .icon {
  width: 36px;
  height: 36px;
}
.explain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.explain > div {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 13px;
  color: var(--muted);
}
.explain b {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  margin: 8px 0 3px;
}
.explain .icon {
  color: var(--gold-text);
}
@media (max-width: 960px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-visual {
    padding: 22px 20px;
    min-height: auto;
  }
  .auth-visual .auth-pitch,
  .auth-visual .auth-legal,
  .auth-visual .dial,
  .auth-visual::after {
    display: none;
  }
  .auth-panel {
    place-items: start center;
    padding: 24px 16px 48px;
  }
  .auth-card .card {
    padding: 22px;
  }
}
@media (max-width: 520px) {
  .explain {
    grid-template-columns: 1fr;
  }
  .qr-box {
    flex-direction: column;
    align-items: stretch;
  }
  .qr {
    margin: 0 auto;
  }
  .otp input {
    width: 42px;
    height: 52px;
    font-size: 21px;
  }
  .otp {
    gap: 6px;
  }
}

/* ---------- Home ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 300px at 100% 0%, var(--gold-soft), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--surface));
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.hero h1 {
  font-size: 30px;
}
.hero .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 1060px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-list .it {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.check-list .ok {
  color: var(--green);
}
.check-list .todo {
  color: var(--orange);
}
.score {
  --p: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0);
  flex: none;
}
.score span {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-weight: 800;
  font-size: 15px;
}

/* ---------- Launcher ---------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.apps-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.app-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
  min-height: 150px;
}
.app-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.app-tile .name {
  font-weight: 750;
  font-size: 15.5px;
  letter-spacing: 0.02em;
}
.app-tile .desc {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-tile .star {
  position: absolute;
  top: 12px;
  right: 12px;
}
.app-tile .star.on {
  color: var(--gold-text);
}
.app-tile .star.on svg {
  fill: currentColor;
}
.app-tile .foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
}
.app-icon {
  --s: 46px;
  width: var(--s);
  height: var(--s);
  border-radius: calc(var(--s) * 0.28);
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 800;
  font-size: calc(var(--s) * 0.42);
  color: var(--gold-ink);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px rgba(0, 0, 0, 0.22);
}
.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-icon.emoji {
  background: var(--surface-3) !important;
  font-size: calc(var(--s) * 0.5);
}
.app-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-weight: 650;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}
.app-mini:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.app-mini .app-icon {
  --s: 34px;
}

/* ---------- Profile ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 26px 20px;
}
.photo-card .avatar.xl {
  --s: 128px;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--gold-line);
}
.cropper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 340px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  touch-action: none;
  cursor: grab;
}
.cropper canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.cropper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
input[type='range'] {
  accent-color: var(--gold);
  width: 100%;
}

/* ---------- Security ---------- */
.method-row .icon-tile {
  width: 44px;
  height: 44px;
}
.timeline {
  display: flex;
  flex-direction: column;
}
.tl-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.tl-item:last-child {
  border-bottom: 0;
}
.tl-item .icon-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.tl-item .t {
  font-weight: 650;
  font-size: 14px;
}
.tl-item .m {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
}
@media (max-width: 640px) {
  .tl-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .tl-item > :last-child {
    grid-column: 2;
  }
}

/* ---------- Directory ---------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.person-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, transform 0.15s var(--ease);
}
.person-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.person-card .n {
  font-weight: 700;
}
.person-card .j {
  font-size: 13px;
  color: var(--muted);
}
.person-card .o {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--faint);
}
.person-head {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}
.person-head .avatar.xl {
  --s: 112px;
}
.breadcrumb-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.breadcrumb-chain a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.breadcrumb-chain a:hover {
  border-color: var(--border-strong);
}

/* ---------- Org chart ---------- */
.org-scroll {
  overflow: auto;
  padding: 10px 4px 30px;
}
.org-tree,
.org-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.org-tree ul {
  margin-left: 28px;
  padding-left: 18px;
  border-left: 1px solid var(--border-strong);
}
.org-tree li {
  position: relative;
  padding: 7px 0;
}
.org-tree ul > li::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 34px;
  width: 16px;
  height: 1px;
  background: var(--border-strong);
}
.org-tree ul > li:last-child::after {
  content: '';
  position: absolute;
  left: -19px;
  top: 35px;
  bottom: 0;
  width: 2px;
  background: var(--surface);
}
.org-node {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 260px;
  max-width: 100%;
  transition: border-color 0.15s;
}
.org-node:hover {
  border-color: var(--gold-line);
}
.org-node .n {
  font-weight: 700;
  font-size: 14px;
}
.org-node .j {
  font-size: 12.5px;
  color: var(--muted);
}
.org-node .cnt {
  margin-left: auto;
  font-size: 12px;
}
.org-node.me {
  border-color: var(--gold-line);
  background: linear-gradient(0deg, var(--gold-soft), var(--gold-soft)), var(--surface);
}
.office-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.office-card.active {
  border-color: var(--gold-line);
  background: linear-gradient(0deg, var(--gold-soft), var(--gold-soft)), var(--surface);
}

/* ---------- Error page ---------- */
.error-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
