:root {
  --bg-start: #f3f7fc;
  --bg-mid: #edf3fb;
  --bg-end: #e7f0fb;
  --text-main: #1a1a2e;
  --text-muted: #5e6b7a;
  --card: rgba(255, 255, 255, 0.78);
  --card-border: rgba(0, 102, 204, 0.14);
  --primary: #0066cc;
  --primary-hover: #0052a3;
  --accent: #00a3e0;
  --shadow-soft: 0 12px 30px rgba(26, 26, 46, 0.12);
  --shadow-strong: 0 24px 45px rgba(26, 26, 46, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Barlow", "Segoe UI", sans-serif;
  color: var(--text-main);
  background: linear-gradient(120deg, var(--bg-start) 0%, var(--bg-mid) 46%, var(--bg-end) 100%);
  overflow-x: hidden;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 3.5rem 0 2.5rem;
  position: relative;
  z-index: 1;
}

.hero {
  animation: reveal-down 0.8s ease-out both;
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  margin-bottom: 0.7rem;
}

.brand img {
  width: clamp(150px, 22vw, 220px);
  height: auto;
  display: block;
}

.account-panel {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
  padding: 0.45rem 0.55rem 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 102, 204, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.account-name {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.logout-button {
  border: none;
  border-radius: 999px;
  background: rgba(0, 102, 204, 0.1);
  color: var(--primary);
  font-family: inherit;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.logout-button:hover,
.logout-button:focus-visible {
  background: rgba(0, 102, 204, 0.18);
  transform: translateY(-1px);
}

.logout-button:focus-visible {
  outline: 2px solid rgba(0, 163, 224, 0.4);
  outline-offset: 2px;
}

.admin-link-button {
  border: 1px solid rgba(0, 102, 204, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  font-family: inherit;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-link-button:hover,
.admin-link-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(0, 102, 204, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 163, 224, 0.12);
  color: #005b7d;
  border: 1px solid rgba(0, 163, 224, 0.32);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 {
  margin: 0.95rem 0 0.55rem;
  font-family: "Space Grotesk", "Barlow", sans-serif;
  font-size: clamp(1.9rem, 3vw + 1rem, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  max-width: 60ch;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 0.8vw + 0.8rem, 1.18rem);
}

.platforms {
  margin-top: 1.9rem;
}

.platform-grid {
  display: grid;
  gap: 1rem;
}

.zone-block {
  border: 1px solid rgba(0, 102, 204, 0.16);
  border-radius: 1.1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-soft);
  animation: reveal-up 0.55s ease both;
}

.zone-head {
  margin-bottom: 0.9rem;
}

.zone-title {
  margin: 0;
  font-family: "Space Grotesk", "Barlow", sans-serif;
  font-size: clamp(1.1rem, 1.4vw + 0.7rem, 1.45rem);
  line-height: 1.15;
}

.zone-description {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.platform-card {
  grid-column: span 4;
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: 1.05rem;
  padding: 1rem;
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: reveal-up 0.55s ease both;
}

.platform-card::before {
  content: "";
  position: absolute;
  inset: -120% auto auto -25%;
  width: 180px;
  height: 180px;
  border-radius: 100%;
  background: radial-gradient(circle, rgba(14, 165, 163, 0.16) 0%, rgba(14, 165, 163, 0) 70%);
  pointer-events: none;
}

.platform-content {
  position: relative;
}

.platform-name {
  margin: 0;
  font-family: "Space Grotesk", "Barlow", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.platform-description {
  margin: 0.55rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.94rem;
  min-height: 2.7em;
}

.platform-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  text-decoration: none;
  border-radius: 0.8rem;
  padding: 0.72rem 0.9rem;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 20px rgba(0, 102, 204, 0.32);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.platform-link:hover,
.platform-link:focus-visible {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0, 82, 163, 0.4);
}

.platform-link:focus-visible {
  outline: 3px solid rgba(0, 163, 224, 0.4);
  outline-offset: 2px;
}

.footer {
  margin-top: 1.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-top: 2rem;
}

.login-card {
  width: min(580px, 94vw);
  border-radius: 1.15rem;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.83);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-strong);
  padding: clamp(1.2rem, 2vw, 2rem);
  animation: reveal-up 0.6s ease both;
}

.login-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.field-group {
  display: grid;
  gap: 0.35rem;
}

.field-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.field-input {
  width: 100%;
  border: 1px solid rgba(0, 102, 204, 0.22);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.72rem 0.78rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.18);
}

.login-button {
  width: 100%;
  margin-top: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.85rem;
  background: linear-gradient(90deg, #0066cc 0%, #00a3e0 100%);
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(0, 102, 204, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-button:hover,
.login-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 28px rgba(0, 102, 204, 0.42);
  filter: saturate(1.05);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.85;
}

.login-button:focus-visible {
  outline: 3px solid rgba(0, 163, 224, 0.35);
  outline-offset: 2px;
}

.auth-message {
  margin: 0.85rem 0 0;
  color: var(--text-muted);
  min-height: 1.3em;
  font-weight: 500;
}

.auth-message.is-error {
  color: #b42318;
}

.login-help {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.4rem;
  justify-items: start;
}

.auth-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.admin-layout {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 1fr);
  gap: 1rem;
}

.admin-card {
  border: 1px solid rgba(0, 102, 204, 0.16);
  border-radius: 1.1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.admin-form {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.85rem;
}

.admin-fieldset {
  margin: 0;
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 0.8rem;
  padding: 0.75rem;
}

.admin-fieldset legend {
  padding: 0 0.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.checkline:last-child {
  margin-bottom: 0;
}

.permissions-grid {
  display: grid;
  gap: 0.45rem;
  max-height: 250px;
  overflow: auto;
  padding-right: 0.25rem;
}

.permission-item span {
  font-size: 0.94rem;
  color: var(--text-muted);
}

.admin-actions {
  display: flex;
  gap: 0.7rem;
}

.admin-divider {
  border: 0;
  border-top: 1px solid rgba(0, 102, 204, 0.18);
  margin: 1rem 0;
}

.admin-actions .login-button {
  margin-top: 0;
}

.users-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.75rem;
}

.catalog-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.65rem;
}

.user-row {
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 0.85rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.84);
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
}

.user-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.row-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 100%;
  filter: blur(12px);
}

.bg-shape-top {
  width: 380px;
  height: 380px;
  top: -120px;
  right: -110px;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.28) 0%, rgba(0, 102, 204, 0) 72%);
}

.bg-shape-bottom {
  width: 420px;
  height: 420px;
  bottom: -190px;
  left: -130px;
  background: radial-gradient(circle, rgba(0, 163, 224, 0.24) 0%, rgba(0, 163, 224, 0) 72%);
}

@keyframes reveal-down {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes reveal-up {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .platform-card {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100%, 94vw);
    padding-top: 2rem;
  }

  .platform-card {
    grid-column: span 12;
  }

  .platform-description {
    min-height: auto;
  }

  .hero-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-panel {
    width: 100%;
    justify-content: space-between;
    border-radius: 0.8rem;
    padding: 0.55rem 0.65rem;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .user-row {
    flex-direction: column;
  }

  .row-actions {
    width: 100%;
  }
}
