:root {
  color-scheme: light;
  --bg: #f7f2ea;
  --bg-deep: #16130f;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --text: #1d1a16;
  --muted: #746b5f;
  --line: rgba(29, 26, 22, 0.12);
  --primary: #e25d32;
  --primary-dark: #b94322;
  --accent: #255f85;
  --success: #1d7a4d;
  --error: #b3261e;
  --shadow: 0 24px 70px rgba(72, 48, 24, 0.16);
  --radius: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(226, 93, 50, 0.28), transparent 32rem),
    radial-gradient(circle at 85% 15%, rgba(37, 95, 133, 0.22), transparent 28rem),
    linear-gradient(135deg, #fff8ed 0%, var(--bg) 48%, #efe2d0 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(29, 26, 22, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 26, 22, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

a:hover {
  text-decoration: underline;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero > div:first-child,
.status-card,
.panel,
.alert {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero > div:first-child {
  position: relative;
  overflow: hidden;
  padding: 44px;
  border-radius: 36px;
}

.hero > div:first-child::after {
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  content: "";
  border-radius: 42% 58% 66% 34% / 47% 37% 63% 53%;
  background: linear-gradient(135deg, rgba(226, 93, 50, 0.2), rgba(37, 95, 133, 0.18));
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.hero-copy {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.status-card {
  display: flex;
  min-height: 220px;
  padding: 28px;
  border-radius: 36px;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(145deg, rgba(22, 19, 15, 0.95), rgba(50, 38, 27, 0.94)),
    var(--bg-deep);
  color: #fff9ef;
}

.status-dot {
  width: 16px;
  height: 16px;
  margin-bottom: auto;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 10px rgba(74, 222, 128, 0.14);
}

.status-card.is-offline .status-dot {
  background: #fb7185;
  box-shadow: 0 0 0 10px rgba(251, 113, 133, 0.14);
}

.status-card strong {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.status-card small {
  color: rgba(255, 249, 239, 0.7);
}

.alert {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 18px;
  font-weight: 700;
}

.alert-success {
  color: var(--success);
  background: rgba(29, 122, 77, 0.1);
}

.alert-error {
  color: var(--error);
  background: rgba(179, 38, 30, 0.1);
}

.grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.form-panel {
  position: sticky;
  top: 24px;
  padding: 28px;
}

.contacts-panel {
  padding: 28px;
}

.panel-heading h2 {
  margin-bottom: 22px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.contact-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  outline: none;
  background: #fffaf3;
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus {
  border-color: rgba(226, 93, 50, 0.7);
  box-shadow: 0 0 0 5px rgba(226, 93, 50, 0.12);
}

input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover {
  background: var(--primary-dark);
  box-shadow: 0 14px 28px rgba(226, 93, 50, 0.24);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:disabled:hover {
  background: var(--primary);
  box-shadow: none;
  transform: none;
}

.contacts-list {
  display: grid;
  gap: 12px;
}

.contact-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fffaf3;
}

.avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent), #173a52);
  color: white;
  font-size: 1.3rem;
  font-weight: 900;
}

.contact-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.contact-main strong,
.contact-main a,
.contact-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-main strong {
  font-size: 1.05rem;
}

.contact-main span {
  color: var(--muted);
}

.delete-button {
  min-height: 42px;
  border-radius: 999px;
  background: rgba(179, 38, 30, 0.1);
  color: var(--error);
  box-shadow: none;
}

.delete-button:hover {
  background: var(--error);
  color: white;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  padding: 36px;
  border: 1px dashed rgba(29, 26, 22, 0.22);
  border-radius: 24px;
  text-align: center;
  background: #fffaf3;
}

.empty-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 24px;
  background: rgba(226, 93, 50, 0.12);
  color: var(--primary);
  font-size: 2rem;
  font-weight: 900;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 420px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0;
  }

  .hero > div:first-child,
  .status-card,
  .panel {
    border-radius: 24px;
    padding: 22px;
  }

  .contact-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .contact-card form {
    grid-column: 1 / -1;
  }

  .delete-button {
    width: 100%;
  }
}
