/* Hare auth pages */
.auth-main {
  min-height: calc(100vh - 68px);
  padding: 44px 0 84px;
  background:
    linear-gradient(135deg, rgba(34, 199, 216, 0.13) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(225deg, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, #fbfdff 0%, #f5f7fb 58%, #fbfaf8 100%);
}

.auth-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(360px, 480px);
  gap: 36px;
  align-items: center;
  min-height: 620px;
}

.auth-panel.auth-form-only {
  grid-template-columns: minmax(360px, 480px);
  justify-content: center;
}

.auth-card {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 30px;
  border: 1px solid rgba(204, 213, 226, 0.78);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 255, 0.94)),
    #fff;
  box-shadow: 0 26px 70px rgba(35, 45, 75, 0.12);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--tz-primary), #2563eb, #0f8ea0, #10b981);
}

.auth-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.auth-card-icon,
.auth-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--tz-primary-rgb), 0.12), rgba(34, 199, 216, 0.12));
  color: var(--tz-primary);
  font-size: 24px;
  flex-shrink: 0;
}

.auth-card-header h2,
.auth-state-card h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.auth-card-header p,
.auth-state-card p {
  margin: 6px 0 0;
  color: #6b778d;
  font-size: 13px;
  line-height: 1.7;
}

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

.auth-field {
  display: grid;
  gap: 9px;
  min-width: 0;
  color: #253047;
  font-size: 14px;
  font-weight: 850;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  border: 1px solid #dce5f2;
  border-radius: 16px;
  background: #f8fafd;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input-wrap:focus-within {
  border-color: rgba(var(--tz-primary-rgb), 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--tz-primary-rgb), 0.11);
}

.auth-input-wrap i {
  width: 50px;
  color: #7f8ca3;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.auth-input-wrap input {
  width: 100%;
  height: 54px;
  min-width: 0;
  padding: 0 16px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 720;
}

.auth-input-wrap input::placeholder {
  color: #9aa8ba;
  font-weight: 600;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-label-row label {
  color: #253047;
  font-size: 14px;
  font-weight: 850;
}

.auth-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 999px;
  background: #fff;
  color: #526174;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.auth-math-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.auth-math-question {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 1px solid rgba(34, 199, 216, 0.22);
  border-radius: 16px;
  background: rgba(236, 253, 245, 0.78);
  color: #0f766e;
  font-size: 17px;
  font-weight: 900;
}

.auth-submit,
.auth-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tz-primary) 0%, #2563eb 58%, #0f8ea0 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(var(--tz-primary-rgb), 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit:hover,
.auth-secondary-action:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(var(--tz-primary-rgb), 0.3);
  filter: saturate(1.05);
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  color: #65748a;
  font-size: 14px;
  font-weight: 720;
}

.auth-switch a {
  color: var(--tz-primary);
  font-weight: 850;
}

.auth-state-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.auth-state-icon {
  margin-bottom: 18px;
}

.auth-secondary-action {
  width: auto;
  min-width: 160px;
  margin-top: 22px;
  text-decoration: none;
}

.auth-toast {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 3000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  color: #172033;
  font-size: 14px;
  font-weight: 760;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.auth-toast.is-success i {
  color: #10b981;
}

.auth-toast.is-error i {
  color: #ef4444;
}

@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 24px;
  }

}

@media (max-width: 768px) {
  .auth-main {
    padding: 24px 0 92px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .auth-shell {
    width: 100%;
    max-width: 100%;
    padding: 0 14px;
  }

  .auth-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .auth-card-header {
    align-items: flex-start;
  }

  .auth-math-row {
    grid-template-columns: 1fr;
  }

  .auth-math-question {
    min-height: 48px;
  }

  .auth-toast {
    top: 68px;
    right: 14px;
    left: 14px;
    max-width: none;
  }

  .auth-login-main {
    padding-top: 10px;
    padding-bottom: 86px;
  }

  .auth-login-main .auth-panel {
    gap: 12px;
  }

  .auth-login-main .auth-card {
    padding: 22px 18px 24px;
    border-radius: 20px;
  }

  .auth-login-main .auth-card-header {
    margin-bottom: 20px;
  }

  .auth-login-main .auth-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 22px;
  }

  .auth-login-main .auth-form {
    gap: 14px;
  }
}

@media (max-width: 420px) {
  .auth-card-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-label-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-refresh-button {
    width: 100%;
  }

}
