/* WD.1 (2026-06-05) — редизайн экрана входа через Claude Design (handoff bundle).
   Источник: Auth Screen.html. Грузится ТОЛЬКО из tasks/auth.html (per-page файл).
   Скоуп тем — body.auth-page, чтобы не задеть другие страницы.

   Локально доопределяем токены, которых нет в tokens.css (значения из
   colors_and_type.css дизайн-бандла — landing-extensions + системные шрифты).
   Намеренно НЕ трогаем глобальный tokens.css (это кросс-каттинг на все страницы). */
body.auth-page{
  --surface:      #f8fafc;
  --surface2:     #f1f5f9;
  --accent-light: #dbeafe;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell,
               "Noto Sans", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-landing: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;
}

.auth-page *{ box-sizing: border-box; }

body.auth-page{
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1200px 540px at 50% -10%, rgba(37,99,235,.10), transparent 60%),
    linear-gradient(180deg, #eef3fb 0%, var(--surface) 46%, var(--surface) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-wrap{
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* Brand */
.brand{
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-landing);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  text-decoration: none;
}
.brand span{ color: var(--accent); }

/* Card */
.auth-card{
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .05);
  padding: 28px 28px 26px;
}

.auth-head{ margin-bottom: 20px; }
.auth-title{
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.auth-sub{
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

/* Segmented tab switch (tabLogin/tabSignup/tabReset) */
.auth-tabs{
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
}
.auth-tabs a{
  flex: 1;
  text-align: center;
  padding: 7px 6px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
  cursor: pointer;
}
.auth-tabs a:hover{ color: var(--text); }
.auth-tabs a.active{
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .6), 0 1px 2px rgba(37, 99, 235, .35);
}

/* Google provider */
.auth-card .provider-btn{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: 500 14px var(--font-sans);
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.auth-card .provider-btn:hover{ background: var(--surface2); border-color: #c2c9d4; }
.auth-card .provider-btn:active{ transform: translateY(1px); }
.provider-logo{ width: 20px; height: 20px; object-fit: contain; }

/* Divider */
.divider{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-dim);
  font-size: 12px;
}
.divider::before, .divider::after{
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Fields */
.auth-card .form-row{ margin: 0 0 14px; }
.field-label{
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card select{
  width: 100%;
  background: var(--muted);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: 14px var(--font-sans);
  outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.auth-card input::placeholder{ color: #9aa3b2; }
.auth-card input:focus, .auth-card select:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.auth-card select{
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%236b7280' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* Password show/hide */
.pw-wrap{ position: relative; }
.pw-wrap input{ padding-right: 42px; }
.auth-card .pw-toggle{
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-dim);
  padding: 6px 8px;
  line-height: 1;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
}
.auth-card .pw-toggle:hover{ color: var(--text); background: var(--surface2); }

/* Row helpers */
.field-row-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.field-row-head .field-label{ margin-bottom: 0; }
.link-inline{
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.link-inline:hover{ text-decoration: underline; }

/* Role radios → segmented chips */
.role-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.role-chip{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  background: var(--muted);
  transition: all var(--dur-fast) ease;
}
.role-chip svg{ width: 15px; height: 15px; }
.role-chip input{ position: absolute; opacity: 0; pointer-events: none; }
.role-chip:has(input:checked){
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-2);
}

/* Submit button + states */
.auth-card .btn-primary{
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  margin-top: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3b82f6 0%, #1a3fa8 100%);
  color: #fff;
  font: 600 15px var(--font-sans);
  cursor: pointer;
  transition: filter var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
.auth-card .btn-primary:hover{ filter: brightness(1.05); }
.auth-card .btn-primary:active{ transform: translateY(1px); }
.auth-card .btn-primary:disabled{
  cursor: not-allowed;
  filter: none;
  opacity: .62;
}
.btn-primary .spinner{
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authspin .7s linear infinite;
  display: none;
}
.btn-primary.is-loading .spinner{ display: inline-block; }
.btn-primary.is-loading .btn-label{ opacity: .9; }
@keyframes authspin{ to { transform: rotate(360deg); } }

.form-actions{ display: flex; flex-direction: column; gap: 10px; }
.auth-card .resend-btn{
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--text);
  font: 500 14px var(--font-sans);
  cursor: pointer;
}
.auth-card .resend-btn:hover{ background: var(--surface2); }

/* Status / error */
.auth-card .status{
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.45;
  padding: 0;
  color: var(--text-dim);
}
.auth-card .status:empty{ display: none; }
.auth-card .status.is-shown{
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.auth-card .status.success{
  color: #065f46;
  border-color: #0ea572;
  background: rgba(16, 185, 129, .10);
}
.auth-card .status.error{
  color: #991b1b;
  border-color: #cf3d3d;
  background: rgba(239, 68, 68, .10);
}

.hint{
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.auth-foot{
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.auth-foot a{ color: var(--text-dim); }

@media (max-width: 480px){
  .auth-card{ padding: 22px 18px 22px; border-radius: 14px; }
  .auth-wrap{ padding: 22px 14px 36px; }
}
