:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #080c18;
  color: #f4f7ff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 5%, rgba(85, 110, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 88% 20%, rgba(58, 211, 168, 0.1), transparent 26rem),
    #080c18;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  background: rgba(16, 22, 40, 0.82);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #7285ff, #4b5dde);
  box-shadow: 0 12px 30px rgba(83, 103, 232, 0.35);
  color: white;
  font-weight: 800;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 10px;
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8190ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 32px;
}

.muted {
  color: #919bb2;
}

.login-card form {
  margin-top: 30px;
}

.login-card label,
.field span {
  display: block;
  margin-bottom: 8px;
  color: #bac2d5;
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  border: 1px solid #303a55;
  border-radius: 11px;
  outline: none;
  background: #0c1222;
  color: #f7f8ff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-card input {
  height: 48px;
  padding: 0 14px;
}

input:focus {
  border-color: #7587ff;
  box-shadow: 0 0 0 3px rgba(117, 135, 255, 0.13);
}

.primary-button,
.ghost-button,
.icon-button,
.mini-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border-radius: 11px;
  background: linear-gradient(135deg, #7285ff, #5266e6);
  color: white;
  font-weight: 750;
  box-shadow: 0 10px 28px rgba(82, 102, 230, 0.22);
}

.primary-button.compact {
  width: auto;
  height: 40px;
  margin: 0;
  padding: 0 20px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.form-error {
  margin: 10px 0 -8px;
  color: #ff8a9c;
  font-size: 13px;
}

.secure-note {
  margin: 24px 0 0;
  color: #667088;
  font-size: 12px;
  text-align: center;
}

.secure-note span {
  margin-right: 6px;
  color: #45d5a5;
}

.topbar {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  height: 74px;
  margin: auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}

.actions {
  display: flex;
  gap: 8px;
}

.ghost-button,
.mini-button,
.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd2e2;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
}

.ghost-button:hover,
.mini-button:hover,
.icon-button:hover {
  border-color: rgba(117, 135, 255, 0.55);
  background: rgba(117, 135, 255, 0.1);
  color: white;
}

.hero,
.project-groups,
.empty-state {
  width: min(1120px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.hero {
  padding: 76px 0 52px;
}

.hero h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.045em;
}

.hero > p:last-child {
  color: #8f99b0;
  font-size: 17px;
}

.project-group {
  margin-bottom: 42px;
}

.project-group h2 {
  margin-bottom: 14px;
  color: #aeb7cb;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  display: grid;
  min-height: 118px;
  padding: 20px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(17, 23, 41, 0.68);
  color: white;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(117, 135, 255, 0.4);
  background: rgba(25, 33, 57, 0.9);
}

.project-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(123, 142, 255, 0.26);
  border-radius: 13px;
  background: rgba(100, 120, 245, 0.12);
  color: #9eacff;
  font-weight: 800;
}

.project-card strong,
.project-card small {
  display: block;
}

.project-card strong {
  margin-bottom: 7px;
  font-size: 15px;
}

.project-card small {
  overflow: hidden;
  color: #828da6;
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
}

.arrow {
  color: #64708a;
}

.empty-state {
  padding: 80px 0;
  color: #7c879f;
  text-align: center;
}

.manager-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 28px;
  overflow: auto;
  border: 1px solid #2c3651;
  border-radius: 20px;
  background: #0e1424;
  color: #f4f7ff;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.56);
}

.manager-dialog::backdrop {
  background: rgba(2, 5, 12, 0.76);
  backdrop-filter: blur(5px);
}

.dialog-heading,
.dialog-actions,
.editor-controls {
  display: flex;
  align-items: center;
}

.dialog-heading {
  justify-content: space-between;
}

.dialog-heading h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 24px;
}

.project-editor {
  display: grid;
  margin: 24px 0;
  gap: 12px;
}

.editor-row {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 12px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field input {
  height: 38px;
  padding: 0 11px;
}

.editor-controls {
  margin-top: 12px;
  justify-content: flex-end;
  gap: 7px;
}

.switch-label {
  display: flex;
  margin-right: auto;
  align-items: center;
  gap: 7px;
  color: #aeb7cb;
  font-size: 13px;
}

.switch-label input {
  width: auto;
}

.mini-button {
  min-width: 34px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
}

.mini-button.danger {
  color: #ff8b9b;
}

.dialog-actions {
  position: sticky;
  bottom: -28px;
  margin: 0 -28px -28px;
  padding: 16px 28px;
  gap: 9px;
  border-top: 1px solid #263049;
  background: #0e1424;
}

.action-spacer {
  flex: 1;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 18px;
  border: 1px solid rgba(117, 135, 255, 0.38);
  border-radius: 11px;
  background: #17203a;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  color: white;
  font-size: 13px;
}

@media (max-width: 820px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 30px 24px;
  }

  .topbar {
    width: calc(100% - 24px);
  }

  .brand > span:last-child {
    display: none;
  }

  .hero,
  .project-groups,
  .empty-state {
    width: calc(100% - 28px);
  }

  .hero {
    padding-top: 52px;
  }

  .project-grid,
  .editor-fields {
    grid-template-columns: 1fr;
  }

  .manager-dialog {
    padding: 20px;
  }

  .dialog-actions {
    bottom: -20px;
    margin: 0 -20px -20px;
    padding: 14px 20px;
  }
}
