﻿:root {
  --bg-0: #060b15;
  --bg-1: #0a1630;
  --ink-0: #eaf1ff;
  --ink-1: #a9bada;
  --card: rgba(9, 18, 34, 0.82);
  --line: rgba(170, 195, 235, 0.2);
  --brand: #7da0d9;
  --accent: #c6954d;
}

* { box-sizing: border-box; }

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink-0);
  background: radial-gradient(1100px 700px at 80% -10%, rgba(198, 149, 77, 0.2), transparent 60%),
              radial-gradient(900px 600px at -10% 0%, rgba(73, 113, 183, 0.24), transparent 60%),
              linear-gradient(150deg, var(--bg-1), var(--bg-0));
}

.page-bg {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(125, 160, 217, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(125, 160, 217, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.shell {
  position: relative;
  width: min(1240px, 94vw);
  margin: 2.2rem auto 2.8rem;
}

.hero {
  margin-bottom: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  background: rgba(9, 16, 32, 0.66);
}

.brand-logo {
  width: clamp(220px, 24vw, 520px);
  height: auto;
  object-fit: contain;
}

.brand-meta h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.5vw, 2.35rem);
  letter-spacing: 0.02em;
}

.brand-meta p {
  margin: 0.25rem 0 0;
  color: var(--ink-1);
  font-size: clamp(0.95rem, 1.4vw, 1.12rem);
}

.auth-card {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 16, 32, 0.72);
  backdrop-filter: blur(8px);
}

.auth-section {
  width: 100%;
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.auth-badge {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  border: 1px solid var(--line);
}

.auth-badge.auth-on {
  color: #cbffd8;
  border-color: rgba(108, 199, 129, 0.6);
  background: rgba(59, 128, 75, 0.35);
}

.auth-badge.auth-off {
  color: #d6ddee;
  border-color: rgba(167, 181, 211, 0.3);
  background: rgba(76, 88, 112, 0.25);
}

.auth-row {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.auth-row:last-of-type {
  margin-bottom: 0.25rem;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.1rem;
  color: var(--ink-1);
  font-size: 0.86rem;
}

.auth-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(170, 195, 235, 0.26);
  border-radius: 10px;
  background: rgba(5, 12, 24, 0.75);
  color: var(--ink-0);
  padding: 0.58rem 0.68rem;
  font-size: 0.93rem;
}

.auth-code {
  max-width: 170px;
}

.auth-btn {
  border: 1px solid rgba(170, 195, 235, 0.26);
  border-radius: 10px;
  background: rgba(22, 37, 66, 0.7);
  color: var(--ink-0);
  padding: 0.56rem 0.72rem;
  font-size: 0.87rem;
  cursor: pointer;
}

.auth-btn:hover {
  border-color: rgba(198, 149, 77, 0.6);
}

.auth-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.auth-btn-primary {
  background: rgba(55, 98, 168, 0.9);
}

.auth-btn-muted {
  background: rgba(66, 74, 92, 0.75);
}

.auth-app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.auth-menu-right {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.auth-nav-tab {
  border: 1px solid rgba(170, 195, 235, 0.28);
  border-radius: 999px;
  background: rgba(24, 40, 72, 0.65);
  color: var(--ink-0);
  padding: 0.4rem 0.68rem;
  font-size: 0.84rem;
  cursor: pointer;
}

.auth-nav-tab.is-active {
  border-color: rgba(198, 149, 77, 0.62);
  background: rgba(118, 79, 35, 0.52);
}

.auth-message {
  margin: 0;
  min-height: 1.2rem;
  color: var(--ink-1);
  font-size: 0.84rem;
}

.auth-message.is-error {
  color: #ffb2b2;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.tile {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: rgba(198, 149, 77, 0.55);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.tile.locked {
  opacity: 0.65;
}

.tile.locked:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

.tile-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, rgba(20, 39, 74, 0.9), rgba(9, 14, 28, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.tile-fallback {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 2rem;
  color: #0d1a2f;
  background: linear-gradient(145deg, #d8e6ff, #8fb0e8);
}

.tile-body {
  padding: 0.9rem 1rem 1rem;
}

.tile-body h2 {
  margin: 0;
  font-size: 1.05rem;
}

.tile-body p {
  margin: 0.45rem 0 0;
  color: var(--ink-1);
  font-size: 0.92rem;
  line-height: 1.38;
}

.tile-body span {
  display: inline-block;
  margin-top: 0.55rem;
  color: #f0c07a;
  font-size: 0.9rem;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(8, 14, 27, 0.7);
}

.empty h2 { margin: 0 0 0.4rem; }
.empty p { margin: 0; color: var(--ink-1); }

.project-lists {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 14, 27, 0.7);
  padding: 0.9rem;
}

.project-list-head h2 {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
}

.project-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}

.project-list-toolbar h2 {
  margin: 0;
  font-size: 1.08rem;
}

.project-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: flex-end;
}

.project-search {
  width: min(700px, 100%);
  border: 1px solid rgba(170, 195, 235, 0.28);
  border-radius: 999px;
  background: rgba(6, 14, 28, 0.85);
  color: var(--ink-0);
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
}

.project-search:focus {
  outline: none;
  border-color: rgba(198, 149, 77, 0.65);
  box-shadow: 0 0 0 2px rgba(198, 149, 77, 0.16);
}

.scope-badge {
  border-radius: 999px;
  padding: 0.26rem 0.64rem;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.scope-badge-warning {
  color: #ffe6bd;
  border-color: rgba(227, 173, 92, 0.62);
  background: rgba(137, 94, 29, 0.42);
}

.scope-badge-safe {
  color: #cbffd8;
  border-color: rgba(108, 199, 129, 0.62);
  background: rgba(59, 128, 75, 0.35);
}

.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 18, 34, 0.75);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.project-card-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(170, 195, 235, 0.2);
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(14, 28, 52, 0.85), rgba(8, 14, 26, 0.92));
  overflow: hidden;
  display: grid;
  place-items: center;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.project-card-media-fallback {
  color: rgba(220, 230, 250, 0.8);
  font-size: 0.82rem;
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.project-card p {
  margin: 0.16rem 0;
  color: var(--ink-1);
  font-size: 0.84rem;
}

.project-card-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 2.8rem;
  height: 2.8rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.project-action-btn i {
  font-size: 1.15rem;
  line-height: 1;
}

.project-action-danger {
  border-color: rgba(255, 112, 112, 0.7);
  background: rgba(170, 42, 42, 0.5);
  color: #ffe7e7;
}

.project-action-danger:hover {
  border-color: rgba(255, 146, 146, 0.88);
  background: rgba(196, 45, 45, 0.64);
}

.project-action-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: start center;
}

.confirm-modal[hidden] {
  display: none !important;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.confirm-modal-dialog {
  position: relative;
  width: min(460px, 92vw);
  margin: 16vh 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 16, 32, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
  padding: 1rem 1rem 0.9rem;
}

.confirm-modal-dialog h3 {
  margin: 0 0 0.45rem;
  font-size: 1.03rem;
}

.confirm-modal-dialog p {
  margin: 0;
  color: var(--ink-1);
  line-height: 1.42;
}

.confirm-modal-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.project-load-sentinel {
  width: 100%;
  height: 1px;
}

.project-load-info {
  margin: 0.4rem 0 0;
  color: var(--ink-1);
  font-size: 0.84rem;
}

.project-load-info.is-error {
  color: #ffb2b2;
}

@media (max-width: 760px) {
  .shell {
    width: min(1240px, 96vw);
    margin-top: 1rem;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .brand-logo {
    width: min(76vw, 360px);
  }

  .auth-row {
    flex-wrap: wrap;
  }

  .auth-app-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-menu-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .project-search-wrap {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }

  .auth-menu-right {
    width: 100%;
    justify-content: space-between;
  }

  .auth-code {
    max-width: none;
  }

  .project-card-actions {
    gap: 0.55rem;
  }

  .project-action-btn {
    width: 3rem;
    height: 3rem;
  }
}
