/* KupiTour CRM — экран входа */
:root {
  --auth-bg1: #fff9e6;
  --auth-bg2: #f8fafc;
  --auth-accent: #f7c948;
  --auth-accent-dark: #e9b414;
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-line: #e2e8f0;
  --auth-card: #ffffff;
  --auth-danger: #dc2626;
  --auth-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100dvh;
  font: 16px/1.45 Inter, system-ui, -apple-system, sans-serif;
  color: var(--auth-text);
  background: linear-gradient(145deg, var(--auth-bg1) 0%, var(--auth-bg2) 45%, #eef2ff 100%);
}

.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  position: relative;
  overflow: hidden;
}

.auth-page::before,
.auth-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
}

/* На части iPhone тяжёлый blur даёт белый экран — упрощаем фон */
@media (max-width: 900px) {
  .auth-page::before,
  .auth-page::after {
    display: none;
  }
}

.auth-page::before {
  width: 280px; height: 280px;
  background: #fde68a;
  top: -80px; right: -40px;
  animation: auth-float 8s ease-in-out infinite;
}

.auth-page::after {
  width: 220px; height: 220px;
  background: #bfdbfe;
  bottom: -60px; left: -30px;
  animation: auth-float 10s ease-in-out infinite reverse;
}

@keyframes auth-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(18px) scale(1.05); }
}

.auth-shell {
  width: min(420px, 100%);
  position: relative;
  z-index: 1;
  animation: auth-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand {
  text-align: center;
  margin-bottom: 18px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  box-shadow: 0 12px 30px rgba(233, 180, 20, 0.35);
  font-size: 28px;
  margin-bottom: 12px;
}

.auth-brand h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-brand p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--auth-shadow);
  padding: 28px 24px 24px;
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.auth-card .sub {
  margin: 0 0 22px;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #334155;
}

.auth-field input {
  width: 100%;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  background: #fff;
  color: var(--auth-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-accent-dark);
  box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.25);
}

.auth-submit {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 15px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  color: #1f2937;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  box-shadow: 0 10px 24px rgba(233, 180, 20, 0.28);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(233, 180, 20, 0.34);
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.auth-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 14px;
  display: none;
}

.auth-error.show { display: block; animation: auth-shake 0.35s ease; }

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--auth-muted);
  line-height: 1.45;
}

/* Loader */
.auth-loader {
  text-align: center;
  padding: 36px 12px;
}

.auth-loader-orbit {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
}

.auth-loader-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--auth-accent-dark);
  animation: auth-spin 0.9s linear infinite;
}

.auth-loader-orbit span:nth-child(2) {
  inset: 8px;
  border-top-color: #1d4ed8;
  animation-duration: 1.2s;
  animation-direction: reverse;
}

.auth-loader-orbit span:nth-child(3) {
  inset: 16px;
  border-top-color: #059669;
  animation-duration: 0.7s;
}

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

.auth-loader-text {
  margin: 0;
  font-weight: 600;
  color: var(--auth-muted);
}

/* Onboarding banner (settings) */
.auth-onboard-banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
}

.auth-onboard-banner strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.auth-onboard-steps {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.auth-step-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--auth-line);
  color: var(--auth-muted);
}

.auth-step-pill.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.auth-step-pill.active {
  background: #fff;
  border-color: var(--auth-accent-dark);
  color: #92400e;
  box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.2);
}

.auth-onboard-cta {
  margin-top: 14px;
}

.auth-onboard-cta .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  color: #1f2937;
}

.auth-onboard-cta .btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.auth-logout-link {
  display: inline-block;
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  text-decoration: underline;
}
