:root {
  --bg: #eef2f7;
  --card: rgba(255, 255, 255, 0.94);
  --text: #101828;
  --muted: #667085;
  --line: rgba(16, 24, 40, 0.06);
  --blue: #2f80ed;
  --blue-soft: #e9f2ff;
  --green: #2fb36d;
  --green-soft: #e8f7ef;
  --violet: #8b5cf6;
  --violet-soft: #f1ebff;
  --danger: #d63447;
  --shadow: 0 10px 30px rgba(24, 39, 75, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(47, 128, 237, 0.08), transparent 35%),
    linear-gradient(180deg, #f2f5f9 0%, #edf1f6 100%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.app {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: env(safe-area-inset-top, 0) 14px calc(env(safe-area-inset-bottom, 18px) + 24px);
}

.app__header {
  padding: 22px 0 8px;
}

.app__eyebrow {
  font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.app__title {
  font-size: clamp(34px, 8vw, 52px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.app__subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.home-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.home-company-card {
  border-radius: var(--radius-xl);
  padding: 16px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.home-company-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  overflow: hidden;
}

.home-company-logo,
.home-company-logo-fallback {
  width: 100%;
  height: 100%;
}

.home-company-logo {
  object-fit: cover;
}

.home-company-logo-fallback {
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.home-company-label {
  color: var(--muted);
  font-size: 12px;
}

.home-company-name {
  margin: 2px 0 6px;
  font-size: 24px;
}

.home-company-description {
  margin: 0;
  font-size: 14px;
  color: #344054;
}

.home-jk-intro {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
}

.home-jk-title {
  margin: 0;
  font-size: 28px;
}

.home-jk-text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.home-section-label {
  margin: 20px 0 10px;
  color: #687389;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.complex-list {
  display: grid;
  gap: 10px;
}

.complex-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 152px 1fr 24px;
  gap: 12px;
  padding: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
}

.complex-photo-wrap {
  width: 100%;
  height: 84px;
}

.complex-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #d9e6ff;
}

.complex-photo--placeholder {
  background: linear-gradient(140deg, #dce9ff 0%, #a9c8ff 50%, #dce9ff 100%);
}

.complex-info {
  min-width: 0;
}

.complex-name,
.complex-address {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.complex-name {
  font-weight: 700;
  font-size: 16px;
}

.complex-address {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.home-welcome,
.menu-card,
.form,
.success-card,
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.home-welcome {
  border-radius: var(--radius-xl);
  padding: 18px;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 16px;
  isolation: isolate;
}

.home-welcome::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 240px;
  height: 180px;
  background: radial-gradient(circle, rgba(47, 128, 237, 0.12) 0%, rgba(47, 128, 237, 0.04) 55%, transparent 72%);
  z-index: -1;
  border-radius: 50%;
}

.welcome-title {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.welcome-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #243142;
}

.welcome-text .accent {
  color: var(--blue);
  font-weight: 700;
}

.welcome-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.08);
  color: #215fb0;
  font-size: 13px;
  font-weight: 600;
}

.icon-box {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-box svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.9;
}

.icon-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon-green {
  background: var(--green-soft);
  color: var(--green);
}

.icon-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.menu-card {
  border-radius: var(--radius-xl);
  width: 100%;
  padding: 16px;
  display: grid;
  grid-template-columns: 74px 1fr 28px;
  gap: 16px;
  align-items: center;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.menu-card:active {
  transform: scale(0.988);
}

.menu-title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.menu-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.menu-arrow {
  display: grid;
  place-items: center;
  color: var(--blue);
  opacity: 0.95;
}

.menu-arrow svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.1;
}

.form,
.success-card,
.card {
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 14px;
}


.form-back-btn {
  width: 100%;
  border: 1px solid rgba(47, 128, 237, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(47, 128, 237, 0.14), rgba(47, 128, 237, 0.06));
  color: #1f5fae;
  padding: 11px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.form-back-btn:active {
  transform: scale(0.99);
}

.form-intro {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
}

.form-intro h3 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.form-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  margin-bottom: 10px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.field-action-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #215fb0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.field-action-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 12px;
  min-height: 52px;
  font: inherit;
  padding: 12px;
  background: #fff;
}

.field-input-wrap {
  position: relative;
}

.field-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #7d8aa5;
  stroke-width: 1.8;
  pointer-events: none;
}

.field-input--with-icon {
  padding-left: 42px !important;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.autofill-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.1);
  color: #215fb0;
  font-size: 12px;
  font-weight: 600;
}

.field-error {
  min-height: 18px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--danger);
}

.photo-placeholder {
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px dashed rgba(16, 24, 40, 0.18);
  border-radius: 12px;
  color: var(--muted);
}

.photo-placeholder h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.submit-btn,
.btn-secondary {
  width: 100%;
  border: 0;
  border-radius: 12px;
  min-height: 52px;
  font: inherit;
  font-weight: 600;
}

.submit-btn {
  margin-top: 8px;
  color: #fff;
  background: var(--blue);
}

.submit-btn:active {
  background: #1f66c5;
}

.submit-btn:disabled {
  opacity: 0.65;
}

.success-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.btn-secondary {
  border: 1px solid rgba(16, 24, 40, 0.14);
  background: #fff;
}

.global-error {
  margin-top: 12px;
  color: var(--danger);
}

@media (max-width: 360px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .complex-card {
    grid-template-columns: 128px 1fr 22px;
  }

  .complex-photo-wrap {
    height: 76px;
  }
}

@media (min-width: 700px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--wide {
    grid-column: 1 / -1;
  }
}
