:root {
  color-scheme: light;
  --background: #f5f5f3;
  --white: #fff;
  --ink: #1c1c1e;
  --muted: #646467;
  --line: #e3e3e0;
  --red: #c91e24;
  --red-dark: #aa141b;
  --red-wash: #fceceb;
  --shadow: 0 1px 2px #29252108, 0 4px 18px #29252104;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
  background: var(--background);
  color: var(--ink);
}

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

body {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  margin: 0;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.shell {
  width: min(1160px, 100% - 64px);
  margin-inline: auto;
}

.site-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  width: 134px;
  height: auto;
  display: block;
}

.header-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-inline: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #454548;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.header-action:hover,
.button-quiet:hover {
  background-color: var(--red-wash);
  border-color: #f0c9c8;
  color: var(--red-dark);
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  object-fit: contain;
  opacity: .72;
  font-size: 18px;
}

.home-main {
  padding-block: 36px 54px;
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 364px;
  overflow: hidden;
  padding: 52px 58px;
  border-radius: 16px;
  background: #1a1b1d;
  color: var(--white);
}

.hero-image,
.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-image {
  left: 25%;
  background: url('./assets/hardware.webp') 60% 51% / cover no-repeat;
  filter: brightness(.72) contrast(1.08);
}

.hero::after {
  content: '';
  background:
    linear-gradient(90deg, #1a1b1d 4%, #1a1b1d 28%, #1a1b1deb 38%, #1a1b1d48 62%, #1a1b1d06 86%),
    linear-gradient(0deg, #10111372, transparent 70%);
}

.hero-copy {
  position: relative;
}

.hero-accent {
  display: block;
  width: 35px;
  height: 4px;
  margin-bottom: 22px;
  border-radius: 2px;
  background: #ff3437;
}

.hero h1 {
  font-size: clamp(47px, 5vw, 68px);
  font-weight: 800;
  line-height: 1.17;
  letter-spacing: .025em;
}

.hero h1 span {
  display: block;
}

.hero p {
  margin-top: 21px;
  color: #e4e4e6;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .035em;
}

.entries {
  margin-top: 43px;
}

.entries h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 17px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .065em;
}

.entries h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.entries-grid {
  --entry-columns: 2;
  --max-entry-columns: 4;
  display: grid;
  grid-template-columns: repeat(min(var(--entry-columns), var(--max-entry-columns)), minmax(0, 1fr));
  gap: 20px;
}

.entries-grid[data-entry-columns='1'] { --entry-columns: 1; }
.entries-grid[data-entry-columns='3'] { --entry-columns: 3; }
.entries-grid[data-entry-columns='4'] { --entry-columns: 4; }

.entries-grid:is([data-entry-columns='3'], [data-entry-columns='4']) .entry-card {
  gap: 14px;
  padding-inline: 16px;
}

.entry-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 145px;
  padding: 26px 27px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.entry-card:hover {
  transform: translateY(-2px);
  border-color: #eab2b2;
  box-shadow: 0 8px 22px #3911120d;
}

.icon-tile {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--red-wash);
}

.icon-tile .icon {
  font-size: 30px;
  opacity: 1;
  filter: invert(16%) sepia(99%) saturate(3454%) hue-rotate(348deg) brightness(91%) contrast(94%);
}

.entry-copy {
  flex: 1;
  min-width: 0;
}

.entry-copy h3 {
  font-size: 24px;
  font-weight: 750;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.entry-copy p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.entry-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border: 1px solid #e6e6e3;
  border-radius: 50%;
  color: #4c4c50;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.entry-card:is(:hover, :focus-visible) .entry-arrow {
  background-color: var(--red);
  border-color: var(--red);
}

.entry-card:is(:hover, :focus-visible) .entry-arrow .icon {
  opacity: 1;
  filter: invert(1);
}

.site-footer {
  margin-top: auto;
  padding-block: 24px 27px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: .03em;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  text-align: center;
}

.button-primary {
  background: var(--red);
  color: var(--white);
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-quiet {
  background: var(--white);
  border-color: var(--line);
  color: #454548;
  white-space: nowrap;
}

.entry-notice {
  width: min(390px, 100% - 40px);
  max-height: calc(100% - 40px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 14px 70px #18151730;
}

.entry-notice::backdrop {
  background: #17171970;
}

.entry-notice h2 {
  margin-top: 17px;
  font-size: 21px;
}

.entry-notice p {
  margin: 9px 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.entry-notice .button {
  width: 100%;
}

.auth-main,
.manage-main {
  padding-block: clamp(38px, 7vw, 86px) 56px;
}

.auth-main {
  display: grid;
  justify-items: center;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 426px);
  padding: 34px;
}

.auth-card h1,
.manage-heading h1 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 750;
  line-height: 1.3;
}

.auth-card .icon-tile {
  width: 50px;
  height: 50px;
  margin-bottom: 17px;
}

.auth-card .icon-tile .icon {
  font-size: 25px;
}

.page-intro {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 25px;
}

.auth-form .button {
  margin-top: 3px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.field input,
.field select {
  display: block;
  font-family: inherit;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #d4d4d1;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

.field input::placeholder {
  color: #737377;
}

.field input:focus,
.field select:focus {
  border-color: var(--red);
  outline: 2px solid #eb3b3b40;
  outline-offset: 1px;
}

.field input[aria-invalid='true'] {
  border-color: var(--red);
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 58px;
}

.password-control input::-ms-reveal {
  display: none;
}

.password-toggle {
  position: absolute;
  inset: 5px 5px 5px auto;
  padding-inline: 9px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
}

.password-toggle:hover {
  color: var(--red-dark);
  background: var(--red-wash);
}

.manage-main {
  max-width: 740px;
}

.manage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.manage-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 8px;
}

.manage-heading .button {
  min-height: 39px;
  padding: 7px 12px;
  font-size: 13px;
}

.address-form {
  padding-inline: 28px;
}

.entry-settings {
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.settings-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.settings-heading .icon-tile {
  width: 35px;
  height: 35px;
  border-radius: 8px;
}

.settings-heading .icon {
  font-size: 20px;
}

.settings-heading h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 700;
}

.settings-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr);
  gap: 15px;
}

.preferences-fields {
  display: grid;
  gap: 18px;
}

.preferences-fields .field {
  width: min(100%, 380px);
}

.address-status {
  flex: none;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 5px;
  background: #f0efed;
  color: #5f5d59;
  font-size: 12px;
}

.address-status.is-configured {
  background: #e7f5ed;
  color: #275b42;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 21px;
}

.form-actions p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.form-actions .button {
  flex: none;
}

.feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block: 16px;
  padding: 11px 13px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.55;
}

.feedback-error {
  background: var(--red-wash);
  color: var(--red-dark);
}

.feedback-success {
  background: #e7f5ed;
  color: #275b42;
}

.field-error {
  margin-top: 7px;
  color: var(--red-dark);
  font-size: 13px;
  line-height: 1.6;
}

.message-action {
  margin-top: 22px;
}

@media (max-width: 1120px) {
  .entries-grid { --max-entry-columns: 3; }
}

@media (max-width: 844px) {
  .entries-grid { --max-entry-columns: 2; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 40px); }
  .header-inner { min-height: 66px; }
  .brand-logo { width: 112px; }
  .home-main { padding-block: 22px 33px; }
  .hero { min-height: 298px; padding: 35px 30px; border-radius: 13px; }
  .hero h1 { font-size: clamp(38px, 7.2vw, 57px); }
  .hero p { margin-top: 16px; font-size: 14px; }
  .hero-accent { width: 28px; margin-bottom: 15px; }
  .hero-image { left: 0; background-position: 58% center; }
  .hero::after {
    background: linear-gradient(90deg, #1a1b1df5 0%, #1a1b1dcb 25%, #1a1b1d78 65%, #1a1b1d22 100%);
  }
  .entries { margin-top: 30px; }
  .entries h2 { margin-bottom: 13px; font-size: 17px; }
  .entries-grid { gap: 12px; }
  .entry-card { gap: 14px; min-height: 98px; padding: 16px; }
  .entry-card .icon-tile { width: 48px; height: 48px; border-radius: 10px; }
  .entry-card .icon-tile .icon { font-size: 25px; }
  .entry-copy h3 { font-size: 20px; }
  .entry-copy p { margin-top: 4px; font-size: 13px; }
  .entry-arrow { width: 34px; height: 34px; }
  .site-footer { padding-block: 19px; }
  .auth-card { padding: 25px; }
  .address-form { padding-inline: 18px; }
  .settings-fields { grid-template-columns: 1fr; gap: 12px; }
  .form-actions { align-items: stretch; flex-direction: column; gap: 13px; }
}

@media (max-width: 540px) {
  .entries-grid { --max-entry-columns: 1; }
  .manage-heading { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .entry-card, .entry-arrow { transition: none; }
}
