.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    url(../img/bg/clouds.svg) center top / max(1984px, 100%) auto no-repeat,
    var(--zl-page-gradient) center top / 100% 1080px no-repeat,
    var(--zl-page-bg);
  font-family: var(--zl-font);
  color: var(--zl-text);
}

.home-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 22px 0 42px;
  border-bottom: 1px solid var(--zl-grey-light);
  background: var(--zl-white);
}
.home-logo { display: inline-flex; align-items: center; }
.home-logo img { display: block; height: 17px; }

.home-actions { display: flex; align-items: center; }
.home-actions-sep {
  width: 1px;
  height: 27px;
  margin: 0 21px;
  background: var(--zl-grey-light);
}

.zac-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 40px;
  border-radius: 25px;
  background: var(--zl-green);
  box-shadow: var(--zl-shadow-reg);
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  color: var(--zl-white);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  white-space: nowrap;
  transition: background-color .15s ease;
}
.zac-button:hover,
.zac-button:focus { color: var(--zl-white); text-decoration: none; }
.zac-button:hover { background: var(--zl-green-hover); }
.zac-button:active { background: var(--zl-green-dark); }
.zac-button img { display: block; width: 16px; height: 16px; }

.home-user { position: relative; display: flex; border-radius: 50%; outline: none; }
.home-user::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--zl-grey-medium);
  opacity: 0;
  transition: opacity .15s ease;
}
.home-user:hover::before,
.home-user:focus-visible::before { opacity: 1; }
.home-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--zl-grey-light);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}
.home-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zl-green);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--zl-white);
  text-transform: uppercase;
}
.home-user-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 10;
  padding: 8px 16px;
  border-radius: var(--zl-radius-xs);
  background: var(--zl-white);
  filter: var(--zl-shadow-tooltip);
  font-size: 12px;
  line-height: 14px;
  color: var(--zl-input-text);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
}
.home-user:hover .home-user-tooltip,
.home-user:focus .home-user-tooltip { opacity: 1; visibility: visible; }

.home-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--zl-radius-sm);
  background: transparent;
  font-family: var(--zl-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 19.5px;
  color: var(--zl-text-button);
  cursor: pointer;
  transition: color .15s ease;
}
.home-logout:hover { color: var(--zl-red-hover); }
.home-logout:active { color: var(--zl-text-button); }
.home-logout-icon {
  display: block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url(../img/icons/logout.svg) center / contain no-repeat;
  mask: url(../img/icons/logout.svg) center / contain no-repeat;
}

.home-body {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  width: 100%;
  max-width: 904px;
  margin: 0 auto;
  padding: 0 24px;
}

.home-title-box { margin: 48px 0 35px; text-align: center; }
.home-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: -0.6px;
  color: var(--zl-title);
}
.home-subtitle {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 20px;
  color: var(--zl-grey-dark);
}
/* Hidden but keeps its space so the layout doesn't jump. */
.home-subtitle.is-empty { visibility: hidden; }

.home-section + .home-section { margin-top: 32px; }
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--zl-grey-dark);
}
.section-label img { display: block; width: 16px; height: 16px; }
.section-line { flex: 1; height: 1px; margin-left: 4px; background: var(--zl-grey-light); }

.app-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 191px;
  padding: 25px 12px 0;
  border: 1px solid var(--zl-border-card);
  border-radius: var(--zl-radius-xl);
  background: var(--zl-white);
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: background-color .15s ease;
}
.app-card:hover,
.app-card:focus { background: var(--zl-grey-med); color: inherit; text-decoration: none; }
.app-card-icon img { display: block; width: 48px; height: 48px; transition: filter .15s ease; }
.app-card:hover .app-card-icon img,
.app-card.inactive .app-card-icon img { filter: grayscale(1); }
.app-card-title {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 15px;
  color: var(--zl-text-strong);
}
.app-card-desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: normal;
  letter-spacing: 0.12px;
  color: var(--zl-grey-dark);
}
.app-card-arrow {
  position: absolute;
  bottom: 6px;
  left: 50%;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity .15s ease;
}
.app-card-arrow img { display: block; width: 23px; height: 11px; }
.app-card:hover .app-card-arrow,
.app-card:focus .app-card-arrow { opacity: 1; }
.app-card.inactive { opacity: .55; pointer-events: none; cursor: default; }

.downloads-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.downloads-group {
  min-height: 412px;
  overflow: hidden;
  border: 1px solid var(--zl-border-card);
  border-radius: var(--zl-radius-md);
  background: var(--zl-white);
}
.downloads-group-title {
  padding: 12px 16px;
  border-bottom: 1px solid var(--zl-border-row);
  background: var(--zl-panel-head);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--zl-grey-dark);
}
.downloads-list { margin: 0; padding: 0; list-style: none; }

.download-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--zl-border-row);
  color: var(--zl-text);
  text-decoration: none;
  transition: background-color .12s ease;
}
.downloads-list li:last-child .download-row { border-bottom: 0; }
.download-row:hover,
.download-row:focus { background: var(--zl-grey-med); color: var(--zl-text); text-decoration: none; }
.download-row.loading { opacity: .6; pointer-events: none; }

.download-row-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--zl-green-tint-border);
  border-radius: var(--zl-radius-sm);
  background: var(--zl-green-tint);
  transition: background-color .12s ease, border-color .12s ease;
}
/* Drawn as a mask so the glyph color can follow the row state. */
.download-row-glyph {
  width: 20px;
  height: 20px;
  background-color: var(--zl-input-text);
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  transition: background-color .12s ease;
}
.download-row-badge {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
  line-height: 10px;
  color: var(--zl-input-text);
  transition: color .12s ease;
}
.download-row:hover .download-row-icon,
.download-row.loading .download-row-icon { border-color: var(--zl-border-row); background: var(--zl-grey-hover-badge); }
.download-row:hover .download-row-glyph,
.download-row.loading .download-row-glyph { background-color: var(--zl-text-strong); }
.download-row:hover .download-row-badge,
.download-row.loading .download-row-badge { color: var(--zl-text-strong); }

.download-row-text { display: flex; flex-direction: column; min-width: 0; }
.download-row-title { font-size: 14px; font-weight: 500; line-height: 17.5px; color: var(--zl-text); }
.download-row-sub { padding-top: 2px; font-size: 12px; line-height: 16px; color: var(--zl-text-subtle); }

.download-row-download { display: flex; margin-left: auto; opacity: 0; transition: opacity .12s ease-in; }
.download-row-download img { display: block; width: 20px; height: 20px; }
.download-row:hover .download-row-download { opacity: 1; }
.download-row.loading .download-row-download { display: none; }
.download-row-spinner {
  width: 16px;
  height: 16px;
  margin-left: auto;
  border: 2px solid var(--zl-grey-med);
  border-top-color: var(--zl-green);
  border-radius: 50%;
  animation: home-spin .8s linear infinite;
}
@keyframes home-spin { to { transform: rotate(360deg); } }

.home-footer {
  flex: 0 0 auto;
  padding: 24px 0 45px;
  font-size: 16px;
  line-height: 32px;
  letter-spacing: 0.07px;
  text-align: center;
}
.home-footer a { color: var(--zl-grey-dark); text-decoration: none; }
.home-footer a:hover { color: var(--zl-green); }

@media (max-width: 900px) {
  .app-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .home-header { padding: 0 16px; }
  .home-actions-sep { margin: 0 12px; }
  .zac-button { padding: 0 20px; }
  .downloads-groups { grid-template-columns: 1fr; }
  .downloads-group { min-height: 0; }
  .home-title { font-size: 26px; }
}
@media (max-width: 560px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .home-logout-label { display: none; }
}
@media (max-width: 380px) {
  .app-grid { grid-template-columns: 1fr; }
}
