*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: #000000;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.screen.active {
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 120ms ease, background 150ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 22px rgba(236,72,153,0.42);
}

.btn-primary:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  background: var(--secondary);
  color: #fff;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-secondary:hover {
  background: var(--secondary-light);
}

.btn-secondary:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.field-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.11);
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-input.has-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.09);
}

.field-error {
  font-size: 13px;
  color: var(--red);
  display: none;
  align-items: center;
  gap: 5px;
}

.field-error.visible {
  display: flex;
}

.field-error svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.field-input-wrapper {
  position: relative;
}

.field-input-wrapper .field-input {
  padding-right: 48px;
}

.field-input-action {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  transition: color 150ms ease;
}

.field-input-action:hover {
  color: var(--text-secondary);
}

.field-input-action svg {
  width: 18px;
  height: 18px;
}

@media (min-width: 768px) {
  body {
    background: var(--bg);
    overflow: hidden;
  }

  #app {
    max-width: none;
  }
}

.brand-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#pwa-banner {
  position: fixed;
  bottom: calc(54px + max(16px, env(safe-area-inset-bottom)) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 32px);
  max-width: 390px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  z-index: 100;
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.34,1.56,0.64,1), opacity 280ms ease;
}
.pwa-banner-icon { width: 38px; height: 38px; border-radius: 9px; object-fit: contain; flex-shrink: 0; }
.pwa-banner-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pwa-banner-info strong { font-size: 13px; font-weight: 700; color: #0A0A0A; display: block; }
.pwa-banner-text { font-size: 11px; color: rgba(0,0,0,0.5); line-height: 1.4; }
.pwa-install-btn {
  display: inline-flex; align-items: center; height: 28px; padding: 0 14px;
  background: #EC4899; color: #fff; border: none; border-radius: 20px;
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  outline: none; margin-top: 2px; align-self: flex-start;
}
.pwa-install-btn:active { background: #db2777; }
.pwa-banner-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.06); display: flex; align-items: center;
  justify-content: center; cursor: pointer; outline: none; flex-shrink: 0;
  color: rgba(0,0,0,0.5);
}
.pwa-banner-close svg { width: 14px; height: 14px; }

#pc-block {
  display: none;
}

@media (min-width: 768px) {
  #app {
    display: none !important;
  }

  #pc-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    background: #ffffff;
    gap: 20px;
    padding: 40px;
    text-align: center;
  }

  #pc-block img {
    height: 90px;
    width: auto;
    object-fit: contain;
  }

  #pc-block p {
    font-size: 22px;
    font-weight: 800;
    color: #0A0A0A;
    letter-spacing: -0.4px;
    margin: 0;
  }

  #pc-block span {
    font-size: 15px;
    color: rgba(0,0,0,0.45);
    font-weight: 400;
  }
}
