/* Workgram web portal — Spruko light canon
   preview.sprukomarket.com-DESIGN.md (#3366FF, #F1F4FB, Roboto). */

:root {
  --bg: #f1f4fb;
  --bg-elevated: #ffffff;
  --border: #eceefb;
  --border-strong: #dee5f7;
  --text: #212529;
  --text-strong: #17263a;
  --muted: #8497bf;
  --accent: #3366ff;
  --accent-hover: #255bfb;
  --accent-soft: rgba(51, 102, 255, 0.12);
  --danger: #dc3545;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: rgba(196, 205, 224, 0.2) 0px 2.4px 28px 0px;
  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: 0.3s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    calc(clamp(16px, 4vw, 36px) + env(safe-area-inset-right, 0px))
    12px
    calc(clamp(16px, 4vw, 36px) + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  min-width: 0;
}

.brand:hover {
  color: var(--text-strong);
}

.brand:hover .brand-name {
  color: var(--accent);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: color 0.15s ease;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-link-muted {
  color: var(--muted);
}

.btn-compact {
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 64px;
}

@media (max-width: 480px) {
  .main {
    align-items: flex-start;
    padding:
      28px
      16px
      calc(40px + env(safe-area-inset-bottom, 0px));
  }
}

.panel {
  width: min(100%, 440px);
  padding: 8px 4px;
  animation: rise-in 0.45s var(--ease) both;
}

.panel-wide {
  width: min(100%, 640px);
}

.hero {
  text-align: center;
}

.hero-mark {
  width: 120px;
  height: 120px;
  margin: 0 auto 28px;
  display: block;
  animation: rise-in 0.5s var(--ease) both;
}

.hero-brand {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-strong);
  animation: rise-in 0.5s var(--ease) 0.04s both;
}

.hero-lead {
  margin: 0 auto 32px;
  max-width: 22rem;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.45;
  animation: rise-in 0.5s var(--ease) 0.08s both;
}

.hero-actions {
  animation: rise-in 0.5s var(--ease) 0.12s both;
}

.surface {
  width: min(100%, 440px);
  padding: 28px 24px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  color: #263871;
  animation: rise-in 0.45s var(--ease) both;
}

.surface-wide {
  width: min(100%, 640px);
}

.surface-auth {
  padding: 32px 28px 28px;
}

.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
  gap: 12px;
}

.auth-mark {
  width: 52px;
  height: 52px;
  display: block;
}

.surface-auth .page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.page-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.page-lead {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.form-actions {
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out,
    opacity 0.15s ease-in-out;
}

.btn:active {
  opacity: 0.92;
}

.btn i,
.btn [data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(51, 102, 255, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 6px 20px rgba(51, 102, 255, 0.34);
}

.btn-ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff;
}

.btn-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: #263871;
  font: inherit;
  font-size: 15px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field input:hover {
  border-color: var(--border-strong);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(51, 102, 255, 0.2);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #263871;
  caret-color: #263871;
  box-shadow: 0 0 0 1000px #f1f4fb inset;
  transition: background-color 99999s ease-in-out 0s;
}

.error-list {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.28);
  color: var(--danger);
  list-style: none;
  font-size: 0.92rem;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .download-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.download-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.download-card:hover {
  border-color: rgba(51, 102, 255, 0.35);
  box-shadow: rgba(68, 84, 195, 0.2) 0px 0px 10px -5px;
}

.download-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.platform-icon[data-platform="ios"] {
  background: rgba(13, 205, 148, 0.12);
  color: #0dcd94;
}

.platform-icon svg {
  width: 22px;
  height: 22px;
}

.download-meta strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-strong);
}

.download-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.footer-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.45;
}

.footer-note code {
  font-size: 0.85em;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .topbar {
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      10px
      calc(14px + env(safe-area-inset-left, 0px));
    gap: 12px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .nav-link {
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .btn-compact {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.9rem;
  }

  .hero-mark {
    width: 96px;
    height: 96px;
    margin-bottom: 22px;
  }

  .hero-brand {
    font-size: clamp(2rem, 10vw, 2.4rem);
  }

  .hero-lead {
    margin-bottom: 24px;
    font-size: 0.98rem;
  }

  .surface,
  .surface-wide,
  .surface-auth {
    width: 100%;
    padding: 20px 16px;
  }

  .surface-auth {
    padding: 24px 18px 20px;
  }

  .auth-header {
    margin-bottom: 20px;
  }

  .auth-mark {
    width: 44px;
    height: 44px;
  }

  .surface-auth .page-title {
    font-size: 1.35rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .page-lead {
    margin-bottom: 20px;
  }

  .download-card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
