:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #004b7c;
  --muted: #6680a8;
  --brand: #ef334d;
  --brand-dark: #004b7c;
  --brand-soft: #fff1f3;
  --line: #dfe8f2;
  --field: #f6f9fc;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(239, 51, 77, 0.12), transparent 32%),
    #ffffff;
  transition: opacity 420ms ease, visibility 420ms ease;
  animation: loaderExit 420ms ease 3000ms forwards;
}

.loader-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.logo-orbit {
  position: relative;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(0, 75, 124, 0.13);
}

.logo-orbit::before,
.logo-orbit::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--brand);
  border-right-color: rgba(239, 51, 77, 0.24);
  animation: spin 1100ms linear infinite;
}

.logo-orbit::after {
  inset: 9px;
  border-top-color: rgba(0, 75, 124, 0.22);
  border-right-color: rgba(0, 75, 124, 0.08);
  animation-duration: 1500ms;
  animation-direction: reverse;
}

.logo-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  filter: drop-shadow(0 10px 20px rgba(239, 51, 77, 0.18));
  animation: logoSpin 3400ms cubic-bezier(0.58, 0, 0.2, 1) infinite;
}

.loader-text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 420ms ease, transform 420ms ease;
}

.screen {
  width: 100%;
  animation: screenIn 260ms ease both;
}

.screen.is-hidden {
  display: none;
}

.screen.slide-forward {
  animation-name: screenInForward;
}

.screen.slide-back {
  animation-name: screenInBack;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 28px;
  line-height: 1.1;
}

p {
  margin: 0;
}

.lead-text {
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.action-card {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  padding: 12px 14px;
  border: 1px solid rgba(239, 51, 77, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-dark);
  text-decoration: none;
  text-align: left;
  box-shadow:
    0 12px 24px rgba(0, 75, 124, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.action-card:active {
  transform: translateY(1px);
  box-shadow:
    0 12px 24px rgba(0, 75, 124, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.action-card-emergency {
  border-color: rgba(239, 51, 77, 0.5);
  background: linear-gradient(135deg, #ef334d, #c91f37);
  box-shadow:
    0 16px 32px rgba(239, 51, 77, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: emergencyPulse 1500ms ease-in-out infinite;
}

.action-card strong {
  flex: 1;
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1.08;
  font-weight: 800;
}

.action-card-emergency strong {
  color: #ffffff;
}

.action-art {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(239, 51, 77, 0.08);
}

.action-art-emergency {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.action-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.08) brightness(1.08);
}

.action-art-emergency img {
  filter: saturate(1.12) brightness(1.08);
}

.action-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 20px;
  font-weight: 900;
}

.action-arrow::before {
  content: ">";
}

.action-arrow-emergency {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin: 0 0 20px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  background: var(--field);
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--line);
}

.back-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--brand);
  font-size: 19px;
  box-shadow: 0 6px 14px rgba(0, 75, 124, 0.08);
}

.back-icon::before {
  content: "<";
}

.crm-form {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 75, 124, 0.08);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes screenInForward {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes screenInBack {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes loaderExit {
  to {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes emergencyPulse {
  0%,
  100% {
    box-shadow:
      0 16px 32px rgba(239, 51, 77, 0.26),
      0 0 0 0 rgba(239, 51, 77, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  50% {
    box-shadow:
      0 18px 38px rgba(239, 51, 77, 0.38),
      0 0 0 6px rgba(239, 51, 77, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.26);
  }
}

@keyframes logoSpin {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.04);
  }
}
