/* Visual styling for the public NAS service portal. */

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #eef5f1;
  --text: #17202a;
  --muted: #647184;
  --line: #dfe5ec;
  --online: #168a4a;
  --degraded: #b7791f;
  --offline: #b42318;
  --accent: #2457a6;
  --accent-strong: #183e78;
  --focus: #7c3aed;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.login-card {
  width: min(100%, 430px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgb(23 32 42 / 10%);
}

.login-card form,
.login-card label {
  display: grid;
  gap: 10px;
}

.login-card form { gap: 18px; margin: 26px 0 18px; }
.login-card input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.login-card button { padding: 12px; border: 0; border-radius: 10px; background: var(--accent); color: white; font: inherit; cursor: pointer; }
.login-error { min-height: 1.4em; margin: 0; color: #b42318; }
.back-link { color: var(--muted); }

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

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.status-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p,
dl,
dd,
ol {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
}

.lead {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.summary,
.quick-actions,
.service-actions,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary {
  justify-content: flex-end;
}

.summary-pill,
.state,
.tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-pill.online,
.state.online {
  background: #e8f5ee;
  color: var(--online);
}

.summary-pill.degraded,
.state.degraded {
  background: #fff6df;
  color: var(--degraded);
}

.summary-pill.offline,
.state.offline {
  background: #fff0ed;
  color: var(--offline);
}

.quick-actions {
  margin-bottom: 18px;
}

.quick-actions a,
.quick-actions button,
.service-actions a,
.service-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.quick-actions a:first-child,
.service-actions a {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.quick-actions a:focus-visible,
.quick-actions button:focus-visible,
.service-actions a:focus-visible,
.service-actions button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
  outline-offset: 2px;
}

.quick-actions a:hover,
.quick-actions button:hover,
.service-actions a:hover,
.service-actions button:hover {
  border-color: var(--accent);
}

.meta-bar {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.workflow article,
.account-guide article {
  min-height: 88px;
  padding: 16px;
  background: var(--panel-soft);
  border: 1px solid #d4e5dc;
  border-radius: 8px;
}

.workflow strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.workflow span,
.account-guide p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.groups {
  display: grid;
  gap: 30px;
}

.group h2 {
  margin-bottom: 12px;
  font-size: 19px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.service {
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.service-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.service-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  margin-bottom: 5px;
}

.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.dot.online {
  background: var(--online);
}

.dot.degraded {
  background: var(--degraded);
}

.dot.offline {
  background: var(--offline);
}

.service h3 {
  font-size: 18px;
  line-height: 1.25;
}

.service p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tags span {
  min-height: 26px;
  color: #315464;
  background: #edf6fb;
  font-size: 12px;
}

.service-meta {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.service-meta div {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
}

.service-meta dt {
  color: var(--muted);
  font-size: 13px;
}

.service-meta dd {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.steps {
  display: grid;
  gap: 7px;
  padding-left: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.service-actions {
  align-self: end;
  padding-top: 2px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-card h3 {
  font-size: 16px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-card .tags span {
  font-size: 11px;
  min-height: 22px;
  padding: 0 8px;
}

.admin-card .service-actions {
  margin-top: auto;
  padding-top: 4px;
}

@media (max-width: 1020px) {
  .admin-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-card h3 {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.account-guide {
  display: grid;
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.account-guide h2 {
  font-size: 24px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.account-guide h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(320px, calc(100vw - 36px));
  padding: 10px 12px;
  color: #ffffff;
  background: var(--accent-strong);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgb(23 32 42 / 22%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 24px 0 38px;
  }

  .status-head,
  .service-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary {
    justify-content: flex-start;
  }

  .workflow,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions a,
  .quick-actions button,
  .service-actions a,
  .service-actions button {
    flex: 1 1 138px;
  }
}
