/* Auth screens. Loaded only when auth_v2 is on.
   Tokens are linked from the layout, beside this file. */

.auth-v2 {
  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-tint);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-v2 *,
.auth-v2 *::before,
.auth-v2 *::after {
  box-sizing: border-box;
}

.auth-v2-skip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(-160%);
  background: var(--color-surface);
  color: var(--color-navy);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
  font-weight: var(--weight-semibold);
}

.auth-v2-skip:focus {
  transform: none;
}

.auth-v2-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 32px 16px 16px;
}

.auth-v2-card {
  width: 100%;
  max-width: 420px;
  margin: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 28px 20px 32px;
}

.auth-v2-card--wide {
  max-width: 640px;
}

.auth-v2-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-navy);
  font-weight: var(--weight-bold);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.auth-v2-accent {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: none;
}

.auth-v2-mark:hover {
  text-decoration: none;
}

.auth-v2-eyebrow {
  margin: 14px 0 0;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
}

.auth-v2-tagline {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

.auth-v2-sub + .auth-v2-tagline {
  margin: 0 0 22px;
}

.auth-v2 h1 {
  margin: 10px 0 8px;
  color: var(--color-ink);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-v2 h2 {
  margin: 28px 0 8px;
  color: var(--color-ink);
  font-size: 1.25rem;
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
}

.auth-v2-sub,
.auth-v2 .sub {
  margin: 0 0 22px;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.auth-v2-field {
  margin: 0 0 16px;
}

.auth-v2 label,
.auth-v2 legend {
  display: block;
  margin: 0 0 6px;
  color: var(--color-ink);
  font-size: 0.875rem;
  font-weight: var(--weight-semibold);
}

.auth-v2 fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
  min-inline-size: 0;
}

.auth-v2 input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.auth-v2 select,
.auth-v2 textarea {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.auth-v2 textarea {
  min-height: 96px;
  resize: vertical;
}

.auth-v2 select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233d4a5c' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.auth-v2-password {
  position: relative;
}

.auth-v2-password input {
  padding-right: 52px;
}

.auth-v2-reveal {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.auth-v2-password .auth-v2-reveal {
  position: absolute;
  top: 2px;
  right: 2px;
}

.auth-v2-reveal svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
}

.auth-v2-reveal svg[hidden] {
  display: none !important;
}

.auth-v2-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.auth-v2-btn-primary {
  border: 0;
  background: var(--color-navy);
  color: #fff;
}

.auth-v2-btn-primary::after {
  content: "";
  width: 18px;
  height: 18px;
  margin-left: 8px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.75'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.75'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-v2-btn-primary:has(.auth-v2-spinner)::after {
  content: none;
}

.auth-v2-spinner {
  animation: auth-v2-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .auth-v2-spinner {
    animation: none;
  }
}

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

.auth-v2-btn-primary:hover {
  filter: brightness(0.94);
}

.auth-v2-btn-secondary {
  border: 1px solid var(--color-navy);
  background: transparent;
  color: var(--color-navy);
}

.auth-v2-btn-secondary:hover {
  background: var(--color-navy-tint);
}

.auth-v2-btn-primary:focus-visible,
.auth-v2-btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-navy);
}

.auth-v2 :focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

.auth-v2-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 16px;
}

.auth-v2-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-weight: var(--weight-medium);
}

.auth-v2-check input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 1px;
  accent-color: var(--color-navy);
}

.auth-v2-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  font-weight: var(--weight-medium);
}

.auth-v2-choice input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--color-navy);
}

.auth-v2-grid {
  display: grid;
  gap: 0 16px;
}

.auth-v2-meta {
  margin: 16px 0 0;
  color: var(--color-muted);
  font-size: 0.875rem;
  text-align: center;
}

.auth-v2 a {
  color: var(--color-navy);
  font-weight: var(--weight-semibold);
  text-underline-offset: 3px;
}

.auth-v2 a:hover {
  text-decoration-thickness: 2px;
}

.auth-v2-error,
.auth-v2 .hr-field-error {
  display: block;
  margin-top: 6px;
  color: var(--color-danger);
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
}

.auth-v2-hint,
.auth-v2 .hr-hint,
.auth-v2 .hr-note,
.auth-v2 .hr-opt {
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: var(--weight-regular);
}

.auth-v2-hint,
.auth-v2 .hr-hint {
  display: block;
  margin-top: 6px;
}

.auth-v2 .hr-req {
  color: var(--color-danger);
  font-weight: var(--weight-bold);
}

.auth-v2-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
}

.auth-v2-alert ul {
  margin: 0;
  padding-left: 18px;
}

.auth-v2-alert--error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: var(--color-danger);
}

.auth-v2-alert--success {
  background: var(--chip-done-bg);
  border: 1px solid #b7e4c7;
  color: var(--chip-done-ink);
}

.auth-v2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.auth-v2-table th,
.auth-v2-table td {
  padding: 10px 0;
  text-align: left;
  vertical-align: top;
}

.auth-v2-table th {
  width: 46%;
  padding-right: 12px;
  color: var(--color-muted);
  font-weight: var(--weight-semibold);
}

.auth-v2-table tr + tr th,
.auth-v2-table tr + tr td {
  border-top: 1px solid var(--color-border);
}

.auth-v2 .verification-code {
  position: relative;
}

.auth-v2 .verification-code .boxes,
.auth-v2 .verification-code::after {
  display: none;
}

.auth-v2 .verification-code input {
  letter-spacing: 0.2em !important;
  text-indent: 0 !important;
  text-align: center;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.auth-v2 .input-popup {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-bg-tint);
}

.auth-v2 .hover-input-popup .input-popup {
  display: block;
}

.auth-v2 .input-popup p,
.auth-v2 .input-popup p.error {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

.auth-v2 .input-popup p.success {
  color: var(--chip-done-ink);
}

.auth-v2-phone {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 48px;
  min-height: 48px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface);
  overflow: hidden;
}

.auth-v2-phone-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0 12px;
  border-right: 1px solid var(--color-border);
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
  background: var(--color-bg-tint);
}

/* Beat .auth-v2 input:not([type=...]) (0,4,1) so the joined field has one border. */
.auth-v2 .auth-v2-phone > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-v2 .auth-v2-phone > input:focus-visible {
  outline: none;
}

.auth-v2 .auth-v2-phone:focus-within {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

.auth-v2-code {
  margin-bottom: 20px;
}

.auth-v2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-v2-chips > legend,
.auth-v2-chips > .hr-note,
.auth-v2-chips > .auth-v2-error {
  flex: 1 0 100%;
  margin-bottom: 4px;
}

.auth-v2-chips .auth-v2-choice {
  margin: 0;
  padding: 8px 14px;
  min-height: 48px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface);
}

.auth-v2-chips .auth-v2-choice:has(input:checked) {
  border-color: var(--color-navy);
  box-shadow: inset 0 0 0 1px var(--color-navy);
  background: var(--color-navy-tint);
}

.auth-v2 .modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(18, 24, 32, 0.45);
  padding: 24px 16px;
}

.auth-v2 .modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-v2 .modal-dialog {
  width: 100%;
  max-width: 420px;
}

.auth-v2 .modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.auth-v2 .modal-header,
.auth-v2 .modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-v2 .modal-title,
.auth-v2 .modal-body h6 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--weight-semibold);
}

.auth-v2 .hr-footer {
  width: min(100%, 640px);
  margin: 12px auto 0;
  background: transparent !important;
  border-top: 0 !important;
  color: var(--color-muted);
  text-align: center;
}

.auth-v2 .hr-footer .hr-footer__wrap {
  max-width: none;
  padding: 0 8px;
}

.auth-v2 .hr-footer .hr-footer__links {
  justify-content: center;
  row-gap: 6px;
}

.auth-v2 .hr-footer .hr-footer__links li {
  white-space: nowrap;
}

.auth-v2 .hr-footer .hr-footer__links li + li::before {
  content: none;
  padding: 0;
}

.auth-v2 .hr-footer .hr-footer__links li:not(:last-child)::after {
  content: "·";
  padding-left: 10px;
  color: var(--color-muted);
}

@media (max-width: 420px) {
  .auth-v2 .hr-footer .hr-footer__legal p:last-child {
    font-size: 0;
  }

  .auth-v2 .hr-footer .hr-footer__legal p:last-child .hr-footer__nowrap,
  .auth-v2 .hr-footer .hr-footer__legal p:last-child a {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.7;
  }
}

.auth-v2 .hr-footer .hr-footer__legal,
.auth-v2 .hr-footer .hr-footer__legal p {
  text-align: center;
}

.auth-v2 .hr-footer .hr-footer__nowrap {
  white-space: normal;
}

.auth-v2 .hr-footer .hr-footer__name,
.auth-v2 .hr-footer,
.auth-v2 .hr-footer * {
  font-family: var(--font-sans) !important;
}

@media (min-width: 640px) {
  .auth-v2-grid--2 {
    grid-template-columns: 1fr 1fr;
  }

  .auth-v2-card {
    padding: 36px 32px 40px;
  }
}

@media (min-width: 768px) {
  .auth-v2 h1 {
    font-size: 2rem;
  }
}
