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

:root {
  --bg: #0E0E12;
  --accent: #00C2A8;
  --white: #FFFFFF;
  --gray: #E0E0E0;
  --text-primary: #FFFFFF;
  --text-secondary: #E0E0E0;
  --radius: 14px;
  --transition: 300ms ease;

  --type-title-size: 28px;
  --type-body-size: 17px;
  --type-caption-size: 13px;
  --type-button-size: 17px;

  --type-weight-regular: 400;
  --type-weight-medium: 500;
  --type-weight-semibold: 600;
  --type-weight-bold: 700;

  --type-line-height-tight: 1.25;
  --type-line-height-normal: 1.5;
}

@media (max-width: 480px) {
  :root {
    --type-title-size: 24px;
    --type-body-size: 16px;
    --type-button-size: 16px;
  }
}

.type-title {
  font-size: var(--type-title-size);
  font-weight: var(--type-weight-bold);
  line-height: var(--type-line-height-tight);
}
.type-body {
  font-size: var(--type-body-size);
  font-weight: var(--type-weight-regular);
  line-height: var(--type-line-height-normal);
}
.type-caption {
  font-size: var(--type-caption-size);
  font-weight: var(--type-weight-medium);
  line-height: var(--type-line-height-normal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.type-button {
  font-size: var(--type-button-size);
  font-weight: var(--type-weight-semibold);
  line-height: 1;
}

input::placeholder,
textarea::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
input::-moz-placeholder,
textarea::-moz-placeholder {
  color: #E0E0E0;
  opacity: 0.85;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--white);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) 24px env(safe-area-inset-bottom, 0px);
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

/* Header */
.app-header {
  padding: 28px 0 0;
}

.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
}

/* Main */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0;
}

.headline {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--white);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp var(--transition) forwards 100ms;
}

.subline {
  font-size: 17px;
  font-weight: 400;
  color: var(--gray);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp var(--transition) forwards 220ms;
}

/* Footer */
.app-footer {
  padding: 0 0 40px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp var(--transition) forwards 340ms;
}

/* Button */
.btn-primary {
  width: 100%;
  padding: 18px 24px;
  background: var(--accent);
  color: #000000;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.88;
}

/* Back button */
.back-btn {
  position: fixed;
  top: max(18px, calc(env(safe-area-inset-top, 0px) + 10px));
  left: max(16px, env(safe-area-inset-left, 16px));
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #E0E0E0;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  z-index: 200;
  -webkit-tap-highlight-color: transparent;
  transition: color 200ms ease;
}
.back-btn:hover  { color: #FFFFFF; }
.back-btn:active { color: #FFFFFF; transform: scale(0.92); }

/* Animation */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Error library ───────────────────────────────────────────── */
.err-title { font-size: 17px; font-weight: 700; color: #FFFFFF; margin: 0 0 8px; }
.err-body  { font-size: 17px; font-weight: 400; color: #E0E0E0; line-height: 1.5; margin: 0 0 16px; }
.err-action { margin-top: 8px; }
